Page MenuHomePhabricator

Create Wiki syntax for adding an ID to H* tags
Open, Needs TriagePublic

Description

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 ===