From 7ff81723feeffd7def66808ba88978318f70343f Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Mon, 13 Jun 2022 07:24:50 +0100 Subject: add inline code support to HTML --- lib/html.source.sh | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'lib/html.source.sh') diff --git a/lib/html.source.sh b/lib/html.source.sh index fe4c86e..1a35d75 100644 --- a/lib/html.source.sh +++ b/lib/html.source.sh @@ -59,6 +59,16 @@ html::make_link () { echo "$descr
" } +# Make inline code! +html::process_inline_code () { + $SED -E 's|`([^`]+)`|\1|g' +} + +html::process_inline () { + # As of now we only inlinde "code blocks", but we can chain more here later! + html::process_inline_code +} + # Convert Gemtext to HTML html::fromgmi () { local is_list=no @@ -88,29 +98,34 @@ html::fromgmi () { '* '*) is_list=yes echo "