diff options
author | cel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519> | 2020-05-19 19:45:33 -0400 |
---|---|---|
committer | cel <cel@lOUVT+Phkvai9a/cCS/RKo+S9hnPAQdVixms/7ldpPA=.ed25519> | 2020-05-19 20:26:15 -0400 |
commit | 1f08735f01516b8d9989be75b5bcc40f13fa4110 (patch) | |
tree | 9af4821c78bca5f1f695845b51f15588ce6080f4 | |
parent | 0123ab979aaff826b63f29cad644a797fdc6a690 (diff) |
Render heading lines
-rwxr-xr-x | gemini.filter.dpi | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gemini.filter.dpi b/gemini.filter.dpi index e16aee6..bebf3ba 100755 --- a/gemini.filter.dpi +++ b/gemini.filter.dpi @@ -29,7 +29,7 @@ render_gemini() { else sed 's/^\(=>\s*\)\(\S*\)*\(.*\)/\1<a href="\2">\2<\/a>\3/' | awk ' BEGIN { - print "<!doctype html><body style=\"font-family:monospace; white-space:pre-wrap\">" + print "<!doctype html><body style=\"font:monospace; white-space:pre-wrap\">" } /^```/ { if (!in_literal) { @@ -45,6 +45,14 @@ render_gemini() { print next } + /^#+/ { + match($0, /^#+/) + tag = "h" RLENGTH + match($0, /^(#+\s*)/) + text = substr($0, RLENGTH+1) + printf "<%s style=\"font:sans-serif\">%s</%s>", tag, text, tag + next + } { print } |