summaryrefslogtreecommitdiff
path: root/src/macro_processor/macro_processor.rs
diff options
context:
space:
mode:
authorQrius <[email protected]>2024-09-26 00:11:05 +0200
committerQrius <[email protected]>2024-09-26 00:11:05 +0200
commitaea70aee365e52ab666fb34db404264a86e40b37 (patch)
tree2dc9df5b1eaf400b6aef254fb3014f99f558bedb /src/macro_processor/macro_processor.rs
parentb3d8f9033955440d49a4826591db713d5a86bf3a (diff)
downloadskaldpress-aea70aee365e52ab666fb34db404264a86e40b37.tar.gz
skaldpress-aea70aee365e52ab666fb34db404264a86e40b37.zip
Strip leading whitespace in macro arguments
Diffstat (limited to 'src/macro_processor/macro_processor.rs')
-rw-r--r--src/macro_processor/macro_processor.rs5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/macro_processor/macro_processor.rs b/src/macro_processor/macro_processor.rs
index b36783b..866fbdd 100644
--- a/src/macro_processor/macro_processor.rs
+++ b/src/macro_processor/macro_processor.rs
@@ -489,6 +489,11 @@ impl MacroProcessor {
return Ok(out);
};
+ // Strip leading whitespace from arguments
+ for arg in &mut *args {
+ *arg = arg.trim().to_string();
+ }
+
// Log macro invokation
// The fact that we are here, does not ensure that the macro is actually expanded into
// something useful, just that it exists, and was invoked