summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rwxr-xr-xht.awk3
1 files changed, 3 insertions, 0 deletions
diff --git a/ht.awk b/ht.awk index e33fd73..80eb464 100755 --- a/ht.awk +++ b/ht.awk
@@ -113,6 +113,9 @@ $0 ~ ("^" COMMENT_DELIM) {
113 for (lt in LINE_TYPES) { 113 for (lt in LINE_TYPES) {
114 if (match($0, "^" lt "[ \t]*")) { 114 if (match($0, "^" lt "[ \t]*")) {
115 $0 = substr($0, RSTART + RLENGTH) 115 $0 = substr($0, RSTART + RLENGTH)
116 # Escape & in $0 so awk doesn't choke
117 gsub(/&/, "\\\\&", $0)
118 # Expand the template
116 templ = LINE_TYPES[lt] 119 templ = LINE_TYPES[lt]
117 while (match(templ, /\$[0-9-]+/)) { 120 while (match(templ, /\$[0-9-]+/)) {
118 if (substr(templ, RSTART + 1, 1) == "-") { 121 if (substr(templ, RSTART + 1, 1) == "-") {