summaryrefslogtreecommitdiff
path: root/lib/html.source.sh
diff options
context:
space:
mode:
Diffstat (limited to 'lib/html.source.sh')
-rw-r--r--lib/html.source.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/html.source.sh b/lib/html.source.sh
index 8f057a0..b60ac75 100644
--- a/lib/html.source.sh
+++ b/lib/html.source.sh
@@ -71,7 +71,7 @@ html::make_link () {
descr="$link"
fi
- echo "<a class='textlink' href='$($SED 's/'\''/\&#39;/g' <<< "$link")'>$descr</a><br />"
+ echo "<a class='textlink' href='$(html::encode "$link")'>$descr</a><br />"
}
html::process_inline () {
@@ -215,6 +215,10 @@ html::test::default () {
assert::equals "$(generate::make_link html "$line")" \
"<a class='textlink' href='https://example.org'>https://example.org</a><br />"
+ line="=> https://example.org/foo'bar"
+ assert::equals "$(generate::make_link html "$line")" \
+ "<a class='textlink' href='https://example.org/foo&#39;bar'>https://example.org/foo'bar</a><br />"
+
line='=> index.html'
assert::equals "$(generate::make_link html "$line")" \
"<a class='textlink' href='index.html'>index.html</a><br />"