From: Paul Hänsch Date: Wed, 30 Aug 2023 15:31:06 +0000 (+0200) Subject: discriminate between different list markers X-Git-Url: https://git.plutz.net/?a=commitdiff_plain;h=fc3451c360c190736b7355c318f937fe304bb3c4;p=cgilite discriminate between different list markers --- diff --git a/markdown.awk b/markdown.awk index 4b180eb..c42aa5a 100755 --- a/markdown.awk +++ b/markdown.awk @@ -690,12 +690,22 @@ function _block( block, LOCAL, st, len, text, title, attrib, href, guard, code, list = substr( block, 1, RLENGTH); block = substr( block, RLENGTH + 1); return "\n
\n" _dlist( list ) "
\n" _block( block ); - # Unordered list - } else if ( text = _startlist( block, "ul", "[-+*]", "([0-9]+\\.|#\\.)") ) { + # Unordered list types + } else if ( text = _startlist( block, "ul", "-", "([+*]|[0-9]+\\.|#\\.|[0-9]+\\)|#\\))") ) { + return text; + } else if ( text = _startlist( block, "ul", "\\+", "([-*]|[0-9]+\\.|#\\.|[0-9]+\\)|#\\))") ) { + return text; + } else if ( text = _startlist( block, "ul", "\\*", "([-+]|[0-9]+\\.|#\\.|[0-9]+\\)|#\\))") ) { return text; - # Ordered list - } else if ( text = _startlist( block, "ol", "([0-9]+\\.|#\\.)", "[-+*]") ) { + # Ordered list types + } else if ( text = _startlist( block, "ol", "[0-9]+\\.", "([-+*]|#\\.|[0-9]+\\)|#\\))") ) { + return text; + } else if ( text = _startlist( block, "ol", "[0-9]+\\)", "([-+*]|[0-9]+\\.|#\\.|#\\))") ) { + return text; + } else if ( text = _startlist( block, "ol", "#\\.", "([-+*]|[0-9]+\\.|[0-9]+\\)|#\\))") ) { + return text; + } else if ( text = _startlist( block, "ol", "#\\)", "([-+*]|[0-9]+\\.|#\\.|[0-9]+\\))") ) { return text; # Split paragraphs