aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Linskey2026-06-07 01:52:24 -0400
committerBenjamin Linskey2026-06-07 02:04:42 -0400
commit41925025c47abb9b9d0538c4789975bf7c283ca4 (patch)
treee604ff7727342694ee00b8cfd785e824bc9ae41a
parent1f47e0501d53883097718c569023461b0931c15a (diff)
downloadtpl-41925025c47abb9b9d0538c4789975bf7c283ca4.tar.gz

Make spaces in template vars optional

Template variables can now have zero or more whitespace characters between the braces and the variable name.

-rwxr-xr-xtemplate2
1 files changed, 1 insertions, 1 deletions
diff --git a/template b/template
index f039439..1dea77f 100755
--- a/template
+++ b/template
@@ -8,7 +8,7 @@ FILENAME == ARGV[1] { next }
/\{\{.+\}\}/ {
for (key in vals) {
- gsub("\{\{ " key " \}\}"/, vals[key])
+ gsub("\{\{[[:space:]]*" key "[[:space:]]*\}\}", vals[key])
}
}