don't use numeric escapes that's not proper!

This commit is contained in:
yosh 2024-04-19 15:17:49 -04:00
parent 92222d41b8
commit 23499711bc
1 changed files with 8 additions and 6 deletions

View File

@ -44,10 +44,12 @@ __SHLVL=0
# lowdown wrapper function
__lowdown() {
lowdown --html-no-owasp --html-no-skiphtml --html-no-escapehtml "$@" | sed -E '
s/&#821[67];/\'/g
s/–/--/g
s/&#822[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%<*}&lt;${__ESC_STR##*<}" ;;
*\>*) __ESC_STR="${__ESC_STR%>*}&gt;${__ESC_STR##*>}" ;;
*\"*) __ESC_STR="${__ESC_STR%\"*}&quot;${__ESC_STR##*\"}" ;;
*\'*) __ESC_STR="${__ESC_STR%\'*}&#39${__ESC_STR##*\'}" ;;
*\'*) __ESC_STR="${__ESC_STR%\'*}&apos;${__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/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' -e 's/"/\&quot;/g' -e "s/'/\\&#39/g"
sed -e 's/&/\&amp;/g' -e 's/</\&lt;/g' -e 's/>/\&gt;/g' -e 's/"/\&quot;/g' -e "s/'/\\&apos;/g"
}
# build folder structure