From: Paul Hänsch Date: Tue, 6 Jul 2021 16:50:39 +0000 (+0200) Subject: bugfix: stop condition in HTML block X-Git-Url: https://git.plutz.net/?p=cgilite;a=commitdiff_plain;h=fcdebd0c42dcdff43f998a655463658ea2161505 bugfix: stop condition in HTML block --- diff --git a/markdown.awk b/markdown.awk index e652be1..d1de2c3 100755 --- a/markdown.awk +++ b/markdown.awk @@ -263,10 +263,12 @@ function _block( block, LOCAL, st, len, hlvl, htxt, guard, code, indent ) { # HTML #1 } else if ( match( tolower(block), /(^|\n) ? ? ?<(script|pre|style)([[:space:]\n>]).*(<\/script>|<\/pre>|<\/style>|$)/) ) { len = RLENGTH; st = RSTART; + match( tolower(substr(block, st, len)), /(<\/script>|<\/pre>|<\/style>)/); + len = RSTART + RLENGTH; return _block(substr(block, 1, st - 1)) substr(block, st, len) _block(substr(block, st + len)); # HTML #7 - } else if ( match( block, /^ ? ? ?(<\/[A-Za-z][A-Za-z0-9-]* \t]*>|<[A-Za-z][A-Za-z0-9-]*([ \t]+[A-Za-z_:][A-Za-z0-9_\.:-]*[ \t]*=[ \t]*([[:space:]"'=<>`]+|"[^"]*"|'[^']*'))*[ \t]*\/?>)([[:space:]]*\n).*(\n[[:space:]]*\n|$)/) ) { + } else if ( match( block, /^ ? ? ?(<\/[A-Za-z][A-Za-z0-9-]* \t]*>|<[A-Za-z][A-Za-z0-9-]*([ \t]+[A-Za-z_:][A-Za-z0-9_\.:-]*[ \t]*=[ \t]*([[:space:]"'=<>`]+|"[^"]*"|'[^']*'))*[ \t]*\/?>)([[:space:]]*\n)([^\n]|\n[[:space:]]*[^\n])*(\n[ \t]*\n|$)/) ) { len = RLENGTH; st = RSTART; return substr(block, st, len) _block(substr(block, st + len));