From 23499711bc6cfc7ead1c55cea75948912cbc86c0 Mon Sep 17 00:00:00 2001 From: yosh Date: Fri, 19 Apr 2024 15:17:49 -0400 Subject: [PATCH] don't use numeric escapes that's not proper! --- build.sh | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/build.sh b/build.sh index 1660ed9..fe83c65 100644 --- a/build.sh +++ b/build.sh @@ -44,10 +44,12 @@ __SHLVL=0 # lowdown wrapper function __lowdown() { - lowdown --html-no-owasp --html-no-skiphtml --html-no-escapehtml "$@" | sed -E ' - s/̵[67];/\'/g - s/–/--/g - s/̶[01];/\"/g' + lowdown --html-no-owasp --html-no-skiphtml --html-no-escapehtml --html-no-num-ent "$@" | \ + sed -E ' + s/&[lr]squo;/\'/g + s/–/--/g + s/&[lr]dquo;/\"/g + ' } # process a pure markdown file @@ -122,7 +124,7 @@ escape() { *\<*) __ESC_STR="${__ESC_STR%<*}<${__ESC_STR##*<}" ;; *\>*) __ESC_STR="${__ESC_STR%>*}>${__ESC_STR##*>}" ;; *\"*) __ESC_STR="${__ESC_STR%\"*}"${__ESC_STR##*\"}" ;; - *\'*) __ESC_STR="${__ESC_STR%\'*}'${__ESC_STR##*\'}" ;; + *\'*) __ESC_STR="${__ESC_STR%\'*}'${__ESC_STR##*\'}" ;; *) break; esac done @@ -132,7 +134,7 @@ escape() { # good for large inputs with lots of chars to escape # this means mostly full files, entire posts for putting in content for a feed escapepipe() { - sed -e 's/&/\&/g' -e 's//\>/g' -e 's/"/\"/g' -e "s/'/\\'/g" + sed -e 's/&/\&/g' -e 's//\>/g' -e 's/"/\"/g' -e "s/'/\\'/g" } # build folder structure