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

ensure uniqueness of the IDs

parent 34274dd9
No related branches found
No related tags found
No related merge requests found
......@@ -196,6 +196,15 @@ function anchorIt {
"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"
local -l idlc=$id
local idid=ID_${idlc//-/D}
idid=${idid//./P}
[[ $idid = ID_+([0-9A-Z_a-z]) ]] || die \
"internal consistency error on ${idid@Q}"
nameref idv=$idid
[[ -z $idv ]] || die "ID ${id@Q} already used as ${idv@Q}"
idv=$id
idhtm=${|tohtm "$id";}
idltx=${|totex "$id";}
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