\1<\/h2>/' -e 's/^### \(.*\)/\1<\/h3>/' | sed -e 's/\*\*\([^*]*\)\*\*/\1<\/strong>/g' -e 's/\*\([^*]*\)\*/\1<\/em>/g' -e 's/^\- //g' | awk '
BEGIN { in_code = 0; in_list = 0 }
/^```/ { in_code = !in_code; if (in_code) print ""; else print "
"; next }
in_code { print; next }
/^ / {
if (!in_list) { print ""; in_list = 1 }
gsub(/- /, "
- "); print $0; next
}
/^$/ { if (in_list) { print "
"; in_list = 0 }; next }
/^> / { gsub(/^> /, ""); print "" $0 "
"; next }
{ if (NF > 0) print "" $0 "
" }
END { if (in_list) print "" }
')
"; else print ""; next }
in_code { print; next }
/^- "; in_list = 1 }
gsub(/
- /, "
- "); print $0; next } /^$/ { if (in_list) { print "
" $0 ""; next } { if (NF > 0) print "
" $0 "
" } END { if (in_list) print "" } ')