X-Git-Url: http://git.plutz.net/?a=blobdiff_plain;f=cgilite%2Fmarkdown.awk;h=361e6005c3fc42fa5e1f81859d69ec59d0c0a138;hb=dc6472d32f28fbfa9fbf4a9991c3227f1ebf6dc8;hp=512be5d5723da1f9a049bb1ba31241d813dba5ac;hpb=da22ff20e277c767390c172beee569b977f8beee;p=serve0 diff --git a/cgilite/markdown.awk b/cgilite/markdown.awk index 512be5d..361e600 100755 --- a/cgilite/markdown.awk +++ b/cgilite/markdown.awk @@ -274,11 +274,6 @@ function _block( block, LOCAL, st, len, hlvl, htxt, guard, code, indent ) { } else if ( AllowHTML && match( block, /^ ? ? ?(<\/[A-Za-z][A-Za-z0-9-]*[[:space:]]*>|<[A-Za-z][A-Za-z0-9-]*([[:space:]]+[A-Za-z_:][A-Za-z0-9_\.:-]*([[:space:]]*=[[:space:]]*([[:space:]"'=<>`]+|"[^"]*"|'[^']*'))?)*[[:space:]]*\/?>)([[:space:]]*\n)([^\n]|\n[ \t]*[^\n])*(\n[[:space:]]*\n|$)/) ) { len = RLENGTH; st = RSTART; return substr(block, st, len) _block(substr(block, st + len)); - - # Horizontal rule - } else if ( match( block, /(^|\n) ? ? ?((\* *){3,}|(- *){3,}|(_ *){3,})($|\n)/) ) { - len = RLENGTH; st = RSTART; - return _block(substr(block, 1, st - 1)) "
\n" _block(substr(block, st + len)); # Blockquote (leading >) } else if ( match( block, /^> /) ) { @@ -369,6 +364,11 @@ function _block( block, LOCAL, st, len, hlvl, htxt, guard, code, indent ) { return "" inline( htxt ) "\n\n" \ _block( substr( block, len + 1) ); + # Horizontal rule + } else if ( match( block, /(^|\n) ? ? ?((\* *){3,}|(- *){3,}|(_ *){3,})($|\n)/) ) { + len = RLENGTH; st = RSTART; + return _block(substr(block, 1, st - 1)) "
\n" _block(substr(block, st + len)); + # Plain paragraph } else { match( block, /(^|\n)[[:space:]]*(\n|$)/ ) || match( block, /$/ );