From 4db9bbb1b156f8f487a2cce685394f55a338e332 Mon Sep 17 00:00:00 2001 From: Flammie A Pirinen Date: Wed, 19 Jun 2024 14:28:20 +0200 Subject: [PATCH] special symbols in code... --- scripts/doccomments2ghpages-vislcg.awk | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/scripts/doccomments2ghpages-vislcg.awk b/scripts/doccomments2ghpages-vislcg.awk index 142dd882..3504cc1e 100644 --- a/scripts/doccomments2ghpages-vislcg.awk +++ b/scripts/doccomments2ghpages-vislcg.awk @@ -70,14 +70,16 @@ function expand_variables(s) { printf("This construct is not supported anymore:\n `{%s`} ", $0); } /^[^#].*#!!= / { - CODE=gensub("#!!=.*", "", 1); - print(expand_variables(gensub(".*#!!= ", "", 1))); + CODE=gensub("&", "@AMP;", "g", gensub("#!!=.*", "", 1)); + print(gensub("@AMP;", "\\&", "g", + expand_variables(gensub(".*#!!= ", "", 1)))); } /^[^#].*#!!≈ / { - CODE=gensub("[ \t][ \t]*", " ", "g", + CODE=gensub("&", "@AMP;" ,"g", gensub("[ \t][ \t]*", " ", "g", gensub("^[ \t]*", "", 1, - gensub("[ \t]*#!!≈.*", "", 1))); - print(expand_variables(gensub(".*#!!≈ ", "", 1))); + gensub("[ \t]*#!!≈.*", "", 1)))); + print(gensub("@AMP;", "\\&", "g", + expand_variables(gensub(".*#!!≈ ", "", 1)))); } /^#!! / {print(expand_variables(gensub(".*#!! *", "", 1))); } /^[^#]+#!! / {print(expand_variables(gensub(".*#!! *", "", 1))); }