Converting HTML to CommonMark without losing meaning, then writing a table of contents whose links land: how GitHub and GitLab turn headings into anchors.
Converting HTML to Markdown loses meaning in three places: an address that was retyped instead of copied, a character that Markdown reads as syntax at that spot, and an element Markdown has no word for. A table of contents then adds a fourth risk, a link aimed at an anchor that differs from the real one by a single character, which leads nowhere when followed and reports nothing. This guide walks through each break in the order a converter meets it, ending with how GitHub and GitLab build heading anchors and a check that can fail.
Read the full report on AISkills402: https://aiskills402.com/blog/html-to-markdown-and-heading-anchors?utm_source=devto&utm_medium=social
Top comments (0)