md2html: add support for stand-alone pictures

This commit is contained in:
Nero 2022-04-07 16:34:39 +00:00
parent 0d4b08206d
commit 0e069e523a

View File

@ -153,6 +153,15 @@ function inline(text) {
next next
} }
/^!\[.*\]\(.*\)$/ {
txt = $0
filenam = $0
gsub(/(^!\[|\].*$)/, "", txt)
gsub(/(^!.*\(|\)$)/, "", filenam)
oneliner("img",""," src=\"" escape(filenam) "\" alt=\"" escape(txt) "\"")
next
}
{ {
level(prefix "p") level(prefix "p")
printf("%0" indent "s%s\n", "", inline($0)) printf("%0" indent "s%s\n", "", inline($0))