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"
433
+
# anchors, we just prepend something arbitrary.
434
+
anchor_key ="cit-"* anchor_key
435
+
end
436
+
try
437
+
# The Bijection type takes care of all the work of checking for
438
+
# duplicates here.
439
+
cache[citation_key] = anchor_key
440
+
catch
441
+
msg ="Cannot generate HTML anchor for citation key $(repr(citation_key)): normalizes to ambiguous $(repr(anchor_key)) conflicting with citation key $(repr(cache(anchor_key)))"
442
+
error(msg)
443
+
end
444
+
@debug"Generated anchor key $(repr(anchor_key)) for citation key $(repr(citation_key))"
445
+
end
446
+
return anchor_key
447
+
end
448
+
449
+
450
+
# Transform an arbitrary string `s` into a normalized string containing only
451
+
# ASCII letters, numbers, and the symbols `_` and `-`, i.e., matching the regex
452
+
# `r"^[A-Za-z0-9_-]+$"`. Letters with diacritics are normalized into their
453
+
# ASCII equivalents, and all other characters are dropped.
msg ="Cannot generate HTML anchor for citation key \"AbsilMahonySepulchre.2008\": normalizes to ambiguous \"AbsilMahonySepulchre2008\" conflicting with citation key \"AbsilMahonySepulchre:2008\""
0 commit comments