Problem: In order to create shorthand or stable links to sections, editors create fragment IDs (aka anchors) that point to sections that differ from the visible headings. This can be done using {{anchor}}, as in == {{anchor|Anchor}} Heading ==, or its substituted form, == <span id="Anchor"></span> Heading ==, but the first results in bad section links—as in /* {{anchor|Anchor}} Heading */, which shows up as →{{anchor|Anchor}} Heading—while the second is less self-evident as to what it's for, especially to newcomers. Another solution is to put the {{anchor}} or <span>...</span> at the end of the previous section, but this doesn't show up when editing the section (and shows up at the end when editing the previous), which is quite confusing.
Proposed solution: We need a way to add fragment IDs inside section headings that 1) communicates clearly what it's doing and 2) doesn't affect section links. E.g. a parser function like {{#sectionanchor:Anchor name}} that can be used anywhere inside a section and results in <span id="Anchor_name"></span> prepended at the top of (or inserted before) the nearest Hn element before the function call.
This is something that'd definitely be nice, but I'm not sure it rises to the level of importance for me to give it a support. If something was done, perhaps the software could just take templated anchors in section headers and not display them in edit summaries. {{u|Sdkb}}talk23:53, 28 January 2022 (UTC)[reply]
If stable section fragment IDs are needed, the software should just create them automatically, without any user involvement. Also, the rendered page should have links to them, so the links can be easily copied. Silver hr (talk) 19:49, 1 February 2022 (UTC)[reply]
Support I like the idea; I feel like more examples could be given in the proposal, though, such as an example of what such a link would look like vs. how a section title might change. paul2520 (talk) 23:31, 6 February 2022 (UTC)[reply]