"$pfx"[0-9a-fA-F][0-9a-fA-F]*) in="${in#${pfx}}";;
\\*) in="${in#?}"; out="${out}\\\\"; continue;;
%*) in="${in#?}"; out="${out}%%"; continue;;
- *) out="${out}${in%"${in#?}"}"; in="${in#?}"; continue;;
+ *) att="${in%%"${pfx}"*}"; att="${att%%%*}"; att="${att%%\\*}"
+ out="${out}${att}"; in="${in#"${att}"}"; continue;;
esac;
# Hex escapes for printf (e.g. \x41) are not portable
return "<h" hlvl " id=\"" hid " - " HTML(htxt) "\">" inline( htxt ) "</h" hlvl ">\n\n" \
_block( substr( block, len + 1) );
+ # Split paragraphs
+ } else if ( match( block, /(^|\n)[[:space:]]*(\n|$)/) ) {
+ len = RLENGTH; st = RSTART;
+ return _block( substr(block, 1, st - 1) ) "\n" \
+ _block( substr(block, st + len) );
+
# Horizontal rule
} else if ( match( block, /(^|\n) ? ? ?((\* *){3,}|(- *){3,}|(_ *){3,})($|\n)/) ) {
len = RLENGTH; st = RSTART;
# Plain paragraph
} else {
- match( block, /(^|\n)[[:space:]]*(\n|$)/ ) || match( block, /$/ );
- len = RLENGTH; st = RSTART;
- return "<p>" inline( substr(block, 1, st - 1) ) "</p>\n" \
- _block( substr(block, st + len) );
+ return "<p>" inline(block) "</p>\n";
}
}