You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+11Lines changed: 11 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
6
6
7
7
## [Unreleased][]
8
8
9
+
### Added
10
+
11
+
* The `CitationBibliography` plugin object now has an internal field `anchor_keys` that is a bijective mapping of citation keys to HTML anchor names. The anchor names are normalized versions of the citation keys that are restricted to ASCII alphanumerics, dashes (`-`) and underscores (`_`). This provides [compatibility with HTML4](https://www.w3.org/TR/html4/types.html#type-id) and additionally [avoids issues with CSS selectors](https://stackoverflow.com/a/79022). It also works around restrictions of the `Documenter.DOM` framework that is used internally to render HTML content. [[#95][]]
12
+
13
+
14
+
### Fixed
15
+
16
+
* Citation keys the contain special characters (like colons) no longer produce broken links. This is achieved by normalizing HTML anchor names to contain only alphanumeric ASCII characters, dashes, and underscores [[#86][], [#95][]]
17
+
9
18
10
19
## [Version 1.3.7][1.3.7] - 2025-03-29
11
20
@@ -198,8 +207,10 @@ There were several bugs and limitations in version `1.2.x` for which some existi
# Anchors must start with a letter. Instead of rejecting "invalid"
435
+
# anchors, we just prepend something arbitrary.
436
+
anchor_key ="cit-"* anchor_key
437
+
end
438
+
try
439
+
# The Bijection type takes care of all the work of checking for
440
+
# duplicates here.
441
+
cache[citation_key] = anchor_key
442
+
catch
443
+
suffix_index +=1
444
+
msg ="HTML anchor for citation key $(repr(citation_key)) normalizes to ambiguous $(repr(anchor_key)) conflicting with citation key $(repr(cache(anchor_key))). Disambiguating with suffix \"-$(suffix_index)\""
msg ="Warning: HTML anchor for citation key \"AbsilMahonySepulchre.2008\" normalizes to ambiguous \"AbsilMahonySepulchre_2008\" conflicting with citation key \"AbsilMahonySepulchre:2008\". Disambiguating with suffix \"-2\""
msg ="Warning: HTML anchor for citation key \"AbsilMahonySepulchre_=2008\" normalizes to ambiguous \"AbsilMahonySepulchre_2008\" conflicting with citation key \"AbsilMahonySepulchre:2008\". Disambiguating with suffix \"-2\""
54
+
@test contains(c.output, msg)
55
+
msg ="Warning: HTML anchor for citation key \"AbsilMahonySepulchre_=2008\" normalizes to ambiguous \"AbsilMahonySepulchre_2008-2\" conflicting with citation key \"AbsilMahonySepulchre.2008\". Disambiguating with suffix \"-3\""
0 commit comments