# will be copied to the output literally
while [ "$in" ]; do
+ [ "$pfx" ] || case $in in
+ [0-9a-fA-F][0-9a-fA-F]*):;;
+ ?*) out="${out}${in%%"${in#?}"}"
+ in="${in#?}"; continue;;
+ esac
+
case $in in
"$pfx"[0-9a-fA-F][0-9a-fA-F]*) in="${in#${pfx}}";;
\\*) in="${in#?}"; out="${out}\\\\"; continue;;
\&*) out="${out}%26"; str="${str#?}";;
\"*) out="${out}%22"; str="${str#?}";;
\'*) out="${out}%27"; str="${str#?}";;
+ \`*) out="${out}%60"; str="${str#?}";;
\?*) out="${out}%3F"; str="${str#?}";;
\#*) out="${out}%23"; str="${str#?}";;
\[*) out="${out}%5B"; str="${str#?}";;
gsub( /&/, "%26", text );
gsub( /"/, "%22", text );
gsub( /'/, "%27", text );
+ gsub( /`/, "%60", text );
gsub( /\?/, "%3F", text );
gsub( /#/, "%23", text );
gsub( /\[/, "%5B", text );
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 ); gsub( />/, "\\>", code );
return "<code>" code "</code>" inline( substr( line, len + 1 ) )