X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=markdown.awk;h=3fa248d25f2877fdc0e6f7eab9a5642635407d75;hb=8ce6dce8725f84096aebcf1a4063eaeee754b92a;hp=af3d7224657418caa809b5fa6223ce3cc1411224;hpb=628929d8cbd7e2d59dd324f083fddd520c1c6c4d;p=cgilite diff --git a/markdown.awk b/markdown.awk index af3d722..3fa248d 100755 --- a/markdown.awk +++ b/markdown.awk @@ -93,6 +93,7 @@ function URL ( text ) { gsub( /&/, "%26", text ); gsub( /"/, "%22", text ); gsub( /'/, "%27", text ); + gsub( /`/, "%60", text ); gsub( /\?/, "%3F", text ); gsub( /#/, "%23", text ); gsub( /\[/, "%5B", text ); @@ -130,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 ) )