Vote #69740
完了{{toc}} uses identical anchors for subsections with the same name
0%
説明
If you have a wiki page with the following structure:
- Section A 1.1 overview ...
- Section B 2.1 overview ...
the {{toc}} macro cannot distinguish between 1.1 and 2.1, since it uses @#overview#@ for both, thus ending up in 1.1
Redmine version: 1.1.2
journals
Anchor name could be preppend with parent title anchor.
--------------------------------------------------------------------------------
Etienne Massip wrote:
> Anchor name could be preppend with parent title anchor.
I would like to +1 this.
And maybe extend the requirement by allowing custom anchor names. Would be most useful in wiki when trying to write a use guide that would produce a "pretty and informative url"
i.e.
!h1. Transaction
..blah blah blah...
!h2. Expense
..blah blah blah...
!h3. Bank
..blah blah blah...
h4![[transaction-expense-bank-bank-fees|Bank Fees]].
To enter a bank fee click...
--------------------------------------------------------------------------------
Etienne Massip wrote:
> Anchor name could be preppend with parent title anchor.
This is not bullet-proof as it wouldn't make unique anchors with the following:
1. Section A
1.1 overview
1.1.1 subsection
...
2. Section B
2.1 overview
2.1.1 subsection
I fixed it in r8871 by using -2, -3... at the end of anchors (similar to what mediawiki does).
--------------------------------------------------------------------------------
Adam Pullen wrote:
> And maybe extend the requirement by allowing custom anchor names. Would be most useful in wiki when trying to write a use guide that would produce a "pretty and informative url"
This is out of the scope of this fix but you can use @h1(#anchor).@ to have custom anchors. This is part of the textile syntax.
--------------------------------------------------------------------------------
Thank you very much.
This will do just fine.
--------------------------------------------------------------------------------
Merged.
--------------------------------------------------------------------------------