From 0e069e523a21d0acf5b6e3942cc47814ea496ba0 Mon Sep 17 00:00:00 2001 From: Nero <41307858+nero@users.noreply.github.com> Date: Thu, 7 Apr 2022 16:34:39 +0000 Subject: [PATCH] md2html: add support for stand-alone pictures --- md2html | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/md2html b/md2html index f24a737..9ea47df 100755 --- a/md2html +++ b/md2html @@ -153,6 +153,15 @@ function inline(text) { next } +/^!\[.*\]\(.*\)$/ { + txt = $0 + filenam = $0 + gsub(/(^!\[|\].*$)/, "", txt) + gsub(/(^!.*\(|\)$)/, "", filenam) + oneliner("img",""," src=\"" escape(filenam) "\" alt=\"" escape(txt) "\"") + next +} + { level(prefix "p") printf("%0" indent "s%s\n", "", inline($0))