Bug 9728 – Ddoc anchors non-unique across overloads

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-03-15T09:54:00Z
Last change time
2015-02-18T03:38:26Z
Keywords
pull
Assigned to
nobody
Creator
hsteoh

Comments

Comment #0 by hsteoh — 2013-03-15T09:54:15Z
If there are overloaded functions, the same anchor ID is generated for all overloads, making it impossible to link to a specific one. Example code: /// First overload void func() { } /// Second overload void func(int x) { } /// Main void main() {} Ddoc output: <html><head> <META http-equiv="content-type" content="text/html; charset=utf-8"> <title>test</title> </head><body> <h1>test</h1> <!-- Generated by Ddoc from test.d --> <br><br> <dl><dt><big><a name="func"></a>void <u>func</u>(); </big></dt> <dd>First overload<br><br> </dd> <dt><big><a name="func"></a>void <u>func</u>(int <i>x</i>); </big></dt> <dd>Second overload<br><br> </dd> <dt><big><a name="main"></a>void <u>main</u>(); </big></dt> <dd>Main<br><br> </dd> </dl> <hr><small>Page generated by <a href="http://dlang.org/ddoc.html">Ddoc</a>. </small> </body></html> -------- Note that overriding the default Ddoc macros does not help, because DDOC_ANCHOR is only passed the function name, so there is no way to distinguish between overloads. Not to mention, this breaks HTML compliance (anchor names are supposed to be unique).
Comment #1 by bugzilla — 2014-08-15T01:22:21Z
Comment #2 by github-bugzilla — 2014-10-16T20:00:10Z
Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/15b68997d0ae2332ed653658e5d7643fcf0d354f Merge pull request #3862 from ntrel/unique-anchors Fix Issue 9728 - Ddoc anchors non-unique across overloads
Comment #3 by github-bugzilla — 2015-02-18T03:38:26Z