Item1448: Change of the handling of unique anchor names in TOC
Priority: Normal
Current State: Closed
Released In: 1.1.0
Target Release: minor
Applies To: Engine
Component:
Branches:
The handling of unique anchor names is currently rather obscure (bit of a hack job, AFAICT)
Unique anchor names are generated in the context of a topic. But all unique anchor names are cleared whenever a new TOC macro is processed. That means that an anchor generated outside the context of a TOC in an included topic will be lost. Yuck.
Simple enough to re-code to make anchor name contexts specific to the topic being processed. And anchor names should be session specific.
--
CrawfordCurrie - 14 Apr 2009
Recoded anchor names to use a reversible encoding, and moved the rather sad old code into the Compatibility module. The compatibility mode is controlled by a configurations setting, {RequireCompatibleAnchors}, which should be off for new installs and only enabled on old installs that require slavish compatibility with old format anchors. This requires to be highlighted in the release notes. There were very few existing unit tests for the anchor format, so I can't be 100% sure I got it right, but I did my best.
--
CrawfordCurrie - 15 Apr 2009
Do we really need yet another configuration setting? How much do we gain by this, compared to the relative loss of some anchor links?
--
ArthurClemens - 15 Apr 2009
Yes, I think so. The old scheme was broken in several different ways:
- It was about 50 lines of code more complicated than it needed to be
- It was not a reversible encoding, and collapsed repeated characters too much. There was a fairly high probability of a clash between anchors.
- The encoding was not reversible, so given an anchor it was impossible to find the target inside the topic text. When you are trying to use REST references to anchors within topics, this is a requirement.
However you know how people react when anything changes; hence the configuration setting.
--
CrawfordCurrie - 15 Apr 2009
Please remember to set
TargetRelease and
ReleasedIn so I do not get 1.1 and 1.0.5 fixes mixed up and accidently put 1.1 fixes in the 1.0.5 release notes.
--
KennethLavrsen - 16 Apr 2009