From fed1dbf0d164a18b01843323b676d1bff3f628da Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Sat, 8 Apr 2023 12:34:39 +0300 Subject: make validator.w3.org happy about XHTML --- lib/html.source.sh | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'lib/html.source.sh') diff --git a/lib/html.source.sh b/lib/html.source.sh index 0e99853..e148ef1 100644 --- a/lib/html.source.sh +++ b/lib/html.source.sh @@ -28,7 +28,7 @@ html::make_heading () { local -r level="$1"; shift if [ "$HTML_VARIANT_TO_USE" = exact ]; then - #echo "$(html::encode "$text")
" + #echo "$(html::encode "$text")
" echo "$(html::encode "$text")
" else echo "$(html::encode "$text")
" @@ -39,9 +39,9 @@ html::make_heading () { html::make_quote () { local -r quote="${1/> }" if [ "$HTML_VARIANT_TO_USE" = exact ]; then - echo "$(html::encode "$quote")
" + echo "$(html::encode "$quote")
" else - echo "

$(html::encode "$quote")

" + echo "

$(html::encode "$quote")

" fi } @@ -70,11 +70,11 @@ html::make_link () { descr="$link" fi - echo "$descr
" + echo "$descr
" } html::process_inline () { - $SED -E 's|`([^`]+)`|\1|g' + $SED -E "s|\`([^\`]+)\`|\\1|g" } html::add_extras () { @@ -187,23 +187,23 @@ html::test::default () { assert::equals "$(html::make_paragraph "$line")" '

echo foo 2>&1

' line='> This is a quote' - assert::equals "$(html::make_quote "$line")" "

This is a quote

" + assert::equals "$(html::make_quote "$line")" "

This is a quote

" line='Testing: `hello_world.sh --debug` :-) `another one`!' assert::equals "$(echo "$line" | html::process_inline)" \ - "Testing: hello_world.sh --debug :-) another one!" + "Testing: hello_world.sh --debug :-) another one!" line='=> https://example.org' assert::equals "$(generate::make_link html "$line")" \ - "https://example.org
" + "https://example.org
" line='=> index.html' assert::equals "$(generate::make_link html "$line")" \ - "index.html
" + "index.html
" line='=> http://example.org Description of the link' assert::equals "$(generate::make_link html "$line")" \ - "Description of the link
" + "Description of the link
" line='=> http://example.org/image.png' assert::equals "$(generate::make_link html "$line")" \ @@ -239,7 +239,7 @@ html::test::exact () { line='> This is a quote' - assert::equals "$(html::make_quote "$line")" "This is a quote
" + assert::equals "$(html::make_quote "$line")" "This is a quote
" } html::test () { -- cgit v1.2.3