Modify ↓
#9437 closed enhancement (worksforme)
Make addAnchor more robust
Reported by: | Mitar | Owned by: | |
---|---|---|---|
Priority: | normal | Milestone: | |
Component: | general | Version: | 0.11.4 |
Severity: | normal | Keywords: | |
Cc: | mmitar@… | Branch: | |
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
I recommend that addAnchor JavaScript call is more robust like:
$("#content").find("h1,h2,h3,h4,h5,h6").filter("[id]").addAnchor("Link to this section");
In this way those headings without id
would not be processed. Currently they are but there is no use of such anchor link which points to nowhere.
Such headings without ids (or where ids are not appropriate because headings are used in different context) are possible as a result of macros, for example.
Attachments (0)
Change History (2)
comment:1 by , 15 years ago
Resolution: | → worksforme |
---|---|
Status: | new → closed |
comment:2 by , 15 years ago
True. This was discrepancy because I have manually upgraded jQuery but had addAnchor()
for older version.
Note:
See TracTickets
for help on using tickets.
Well, addAnchor() itself takes care of this.