Additional fixes to the html.sed script
It now translates the characters '|' (pipe), '=' (equals) and '%' (percent). Checks were added in md2html.sh in the -s token=value so that token cannot contain an = (equal), | (pipe) or a % (percent) and the value cannot contain a | (pipe). The reason that we cannot disallow a ';' or '&' is because the html entities use those characters so if the sed script were to translate the problematic characters it would cause a problem in the script. Ran make www which updated 1988/robison/index.html and 1990/theorem/index.html. 1986/bright/README.md was fixed with the number of blank lines between sections.
This commit is contained in:
1 parent
9787cc3a12
commit
6fa0f7b69a
6 files changed
+51
-15
No files matched your search
+7
-4
@@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env sed
|
||||
#
|
||||
# bin/html.sed - translate certain characters to HTML & entities
|
||||
# html.sed - translate certain characters to HTML & entities
|
||||
#
|
||||
# This script was written in 2024 November by:
|
||||
#
|
||||
@@ -11,10 +11,10 @@
|
||||
# "Because sometimes even the IOCCC Judges need some help." :-)
|
||||
#
|
||||
# This script will take certain characters, for instance '<', and convert them
|
||||
# to their respective html entity, for instance '<', so that html lints do
|
||||
# to their respective HTML entity, for instance '<', so that HTML lints do
|
||||
# not complain.
|
||||
#
|
||||
# For a list of the other html entities, should others be needed, see:
|
||||
# For a list of the other HTML entities, should others be needed, see:
|
||||
#
|
||||
# https://www.w3schools.com/html/html_entities.asp
|
||||
#
|
||||
@@ -26,7 +26,7 @@
|
||||
#
|
||||
# sed -i -f bin/html.sed file
|
||||
#
|
||||
# VERSION="1.0 2024-11-04"
|
||||
# VERSION="1.1 2024-11-07"
|
||||
|
||||
# IMPORTANT NOTE: the '&' substitution MUST come first! This is because the
|
||||
# other substitutions have '&'s in them and if the '&' came after it would
|
||||
@@ -34,3 +34,6 @@
|
||||
s/&/\\\&/g
|
||||
s/</\\\</g
|
||||
s/>/\\\>/g
|
||||
s/|/\\\|/g
|
||||
s/=/\\\=/g
|
||||
s/%/\\\%/g
|
||||
Reference in new issue
Block a user