summaryrefslogtreecommitdiff
path: root/lib/html.source.sh
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2022-01-03 10:10:43 +0000
committerPaul Buetow <paul@buetow.org>2022-01-03 10:10:43 +0000
commit7f3318ecab9b9ffedc47e0a9d247dc5fdf9b2893 (patch)
treee23c0aebeeeb488f21f4a11662c5370efb9cb3db /lib/html.source.sh
parent92cc75eb119f9aff696a84aded2ed33ebe00f54a (diff)
fix HTML encodings in lists
Diffstat (limited to 'lib/html.source.sh')
-rw-r--r--lib/html.source.sh5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/html.source.sh b/lib/html.source.sh
index a7e7717..fe4c86e 100644
--- a/lib/html.source.sh
+++ b/lib/html.source.sh
@@ -88,7 +88,7 @@ html::fromgmi () {
'* '*)
is_list=yes
echo "<ul>"
- echo "<li>${line/\* /}</li>"
+ echo "<li>$(html::encode "${line/\* /}")</li>"
;;
'```'*)
is_plain=yes
@@ -127,6 +127,9 @@ html::test () {
line='Foo &<>& Bar!'
assert::equals "$(html::make_paragraph "$line")" '<p>Foo &amp;&lt;&gt;&amp; Bar!</p>'
+ line='echo foo 2>&1'
+ assert::equals "$(html::make_paragraph "$line")" '<p>echo foo 2&gt;&amp;1</p>'
+
line='# Header 1'
assert::equals "$(html::make_heading "$line" 1)" '<h1>Header 1</h1>'