From: Paul Hänsch (
ends section
+# - [ ]
terminates section
# - [x] Automatic heading identifiers (custom)
# - [x] Fenced code blocks (php md, pandoc)
# - [x] Fenced code attributes
@@ -741,10 +741,11 @@ function _block( block, LOCAL, st, len, text, title, attrib, href, guard, code,
}
}
-function _list (block, mark, LOCAL, len, st, text, indent, task) {
+function _list (block, mark, p, LOCAL, len, st, text, indent, task) {
if ( match(block, "^([ \t]*\n)*$")) return;
match(block, "^" mark "[ \t]"); indent = RLENGTH;
sub("^" mark "[ \t]", "", block);
+ if (match(block, /\n[ \t]*\n/)) p = 1;
match( block, "\n" mark "[ \t][^\n]+(\n|$)" \
"(([ \t]*\n)* ? ? ?" mark "[ \t][^\n]+(\n|$)" \
@@ -763,10 +764,10 @@ function _list (block, mark, LOCAL, len, st, text, indent, task) {
sub(/^\[[-? /xX]\]/, "", text);
text = _nblock( text );
- if (match( text, "^
(
]|[^p]|<[^/]|[^<])*\n$" )) gsub( "(^|
\n$)", "", text); - return task text "\n" _list(block, mark); + return task text "\n" _list(block, mark, p); } function _dlist (block, LOCAL, len, st, text, indent, p) {