From: Paul Hänsch Date: Mon, 19 Jun 2023 13:32:07 +0000 (+0200) Subject: bugfix: do not accidentally strip white spaces from code spans X-Git-Url: http://git.plutz.net/?p=cgilite;a=commitdiff_plain;h=8ce6dce8725f84096aebcf1a4063eaeee754b92a bugfix: do not accidentally strip white spaces from code spans --- diff --git a/markdown.awk b/markdown.awk index a50f7a2..3fa248d 100755 --- a/markdown.awk +++ b/markdown.awk @@ -131,7 +131,7 @@ function inline( line, LOCAL, len, code, href, guard ) { code = substr( line, len + 1, match( substr(line, len + 1), guard ) - 1) len = 2 * length(guard) + length(code) # strip single surrounding white spaces - code = gensub( / (.*) /, "\\1", "1" , code) + code = gensub( /^ | $/, "", "g" , code) # escape HTML within code span gsub( /&/, "\\&", code ); gsub( //, "\\>", code ); return "" code "" inline( substr( line, len + 1 ) )