Talk:Community Wishlist/W260
Add topicAnchors
[edit]It seems like anchors themselves might be a workaround for something like a sticky link to a section header, which could be followed or linked to for sharing, etc. Is that the real problem? JWheeler-WMF (talk) 15:25, 22 August 2024 (UTC)
- In a way, yes? But I don't know what the alternative could possibly be. Let's say each section had an ID like pages do, then how would you know which section is the rightful successor of which after e.g. the order of two sections was swapped and they were both renamed? I don't know what could possibly replace human-edited anchors. Nardog (talk) 04:41, 23 August 2024 (UTC)
- It could be new native wiki syntax, e.g.
== Foo | Bar | Baz ==turning intobut that seems overkill and politically difficult to implement, hence my proposal of a parser function. Nardog (talk) 05:08, 23 August 2024 (UTC)<div class="mw-heading mw-heading2"> <h2 id="Baz"> <span id="Foo"></span> <span id="Bar"></span> Baz </h2> </div>
Template:Discuss en.wikipedia
[edit]Thanks wishlist. I also created a discussion on en.wiki.
The problem with setting anchors in titles is that it leads to repetition a lot, unless there is a way around that. For example /* =={{anchor|text}} Text== */ It doesn't show on preview/articles but does in wikicode. Catcus DeMeowwy (talk) 19:17, 13 April 2026 (UTC)
Phab ticket T307868
[edit]I added a ticket about this to Phabricator back in May 2022. There has not been any feedback on the ticket since.
Create Wiki syntax for adding an ID to H* tags
Headings are often used as targets in wiki links.
However, the heading text can change and so templates often exist to add an ID to use as a link fragment.
The template is often added:
- below the heading — This may leave the heading out of sight above the display after following the link
- above the heading — This is "more correct" for displaying the heading, but the template is not included within a section edit
- inside the heading — This is simpler for editing, but pollutes an edit summary following a section edit
The "correct" solution to all this is to define a wiki syntax for headings that will add the fragment ID to the H* tag itself.
Possible choices might be:
- ===The heading#fragmentID=== — unsafe as the hash character could possibly be an intended part of the heading text
- ===The heading|fragmentID=== — ditto with the pipe character
- ===The heading===fragmentID — Probably safe, as headings currently should not have any following text
- ===The heading===fragmentID=== — Probably more safe, as existing headings cannot already contain ===