Skip to content
Snippets Groups Projects
Verified Commit 34274dd9 authored by mirabilos's avatar mirabilos Committed by mirabilos
Browse files

test IDs for XML (for XHTML) and HTML 4 syntax compliance

and fuck HTML 5 which allows “anything but a space”, srsly‽

oh and they are case-sensitive in XML and XHTML {1,2,5}
but case-insensitive in HTML {4,5}…
parent a770bc30
No related branches found
No related tags found
No related merge requests found
...@@ -192,6 +192,10 @@ function getpc { ...@@ -192,6 +192,10 @@ function getpc {
function anchorIt { function anchorIt {
local id=$cw idhtm idltx lbl=$line lblhtm lblltx ltxit local id=$cw idhtm idltx lbl=$line lblhtm lblltx ltxit
[[ $id = [A-Z_a-z]*([A-Z_a-z0-9.-]) ]] || die \
"item identifyer ${id@Q} is not a valid ASCII xml:id NCName"
[[ $id = [A-Za-z]*([A-Za-z0-9_:.-]) ]] || die \
"item identifyer ${id@Q} is not a valid HTML 4 id attribute"
idhtm=${|tohtm "$id";} idhtm=${|tohtm "$id";}
idltx=${|totex "$id";} idltx=${|totex "$id";}
if [[ -z $lbl ]]; then if [[ -z $lbl ]]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment