Markdownlint: Markdownlint and TOP web app generate different heading IDs/fragments #28328
Open
3 of 9 tasks
Labels
Content: Markdownlint
Involves anything related to the curriculum repo linter
Checks
Describe your suggestion
Markdownlint's TOP051 rule (valid link fragments) uses GitHub's heading algorithm for generating link fragments from headings. This preserves dashes, so a heading like
### Title - Subtitle
will generatetitle---subtitle
.TOP's web app's id/fragment generation removes these isolated dashes, so the above will become
foo-bar
.#title---subtitle
will not scroll to the correct heading on our website but#title-subtitle
will, except Markdownlint will flag#title-subtitle
as an invalid link fragment as it expects#title---subtitle
instead. This situation occurred recently in #28327.A solution would be to replace dashes surrounded by spaces (so hyphenated words are preserved) with a colon and single space, since both serve to separate "parts" of a heading.
i.e.
### Title - subtitle
should be fixable to### Title: Subtitle
.Acceptance criteria
SPACE DASH SPACE
, and suggest the colon equivalent in the error message.md
file should demonstrate all reasonable positive and negative cases.markdownlint-cli2.jsonc
config file custom rules arrayPath
Other / NA
Lesson Url
N/A
(Optional) Discord Name
No response
(Optional) Additional Comments
No response
The text was updated successfully, but these errors were encountered: