-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Open
Description
It's very popular request to add header ancors. Prior to do it, we need to discuss possible security problems and solutions.
Read first
- Use id attribute instead of name for ToC gjtorikian/html-pipeline#111 (comment) - discussion about github implementation
- http://www.slideshare.net/x00mario/in-the-dom-no-one-will-hear-you-scream - awesome presentation about dom clobbering
Problems:
id- collisionsname- dom clobbering- cross-conflicts when multiple docs on the same page have the same headers
Possible solutions
- Do nothing
- unsafe, you need to control content, or site will be vulnerable
- Add prefix
- will require js to keep references work
- without js will make manual references typing not convenient
- does anyone type such way?
- not a problem for autogenerated tocs (we can add prefix to both anchors and refs)
- Add per-doc unique prefix
- not convenient in use. required in very limited cases
Need to discuss better solutions, and what to do by default, because anchors are really needed
current status
- Must have not empty default prefix
options.anchorPrefix- instance default.env.anchorPrefix- every-time-render override
- Open questions:
- default prefix name?
-or--of no objections (short and easy to type)
- should we autofix local relative anchor links? any bad side effects?
- default prefix name?
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels