Skip to content

Instantly share code, notes, and snippets.

In 2021 the Open Web Docs team, with help from Mozilla, the W3C, and the wider web docs community, converted the authoring format for MDN Web Docs - all 11,000 pages of it - from HTML to Markdown. In this post we'll talk about why we did it, how we did it, and how it turned out.

HTML soup

Before 2020 MDN was a Wiki, and contributors edited pages using a web-based WYSIWYG HTML editor. This made it easy to make casual contributions: people could edit text and apply simple formatting, like bold or code, without having to edit the underlying HTML. But a WYSIWYG editor is not well-suited to more complex edits, and authors often had to edit the underlying HTML source directly. Also, because the underlying source was hidden by default, HTML cruft, like <span id="486uw3y3"> crept into the source, often from authors pasting HTML from another rich editing environment into the MDN WYSIWYG editor.

In 2020 MDN replaced the old Wiki with a new platform in which the source for the docs was stored in a GitHub

Report from 10/24/2021, 10:23:08 AM

All unhandled elements

  • div.hidden (369)
  • td (74)
  • table.fullwidth-table.standard-table (66)
  • tr (31)
  • kbd (26)
  • table.standard-table (8)
  • th (4)
  • table (3)

Report from 10/14/2021, 4:45:17 PM

All unhandled elements

  • tr (676)
  • th[scope="row"] (628)
  • table.standard-table (103)
  • td (77)
  • th[scope="col"] (60)
  • td[style="vertical-align: top;"] (47)
  • th[rowSpan="2"][scope="row"][style="vertical-align: bottom;"] (16)
  • th[colSpan="4"][scope="col"][style="text-align: center;"] (15)

Report from 10/14/2021, 3:14:56 PM

All unhandled elements

  • tr (14)
  • th[scope="row"] (10)
  • td[rowSpan="3"] (6)
  • table.standard-table (3)
  • td[rowSpan="5"] (3)
  • td[rowSpan="2"] (2)
  • th[rowSpan="2"][scope="row"] (1)

Details per Document

Report from 10/10/2021, 9:33:08 AM

All unhandled elements

  • th (10)
  • tr (4)
  • td (4)
  • table (2)
  • table.standard-table (2)

Details per Document

Invalid AST transformations

Report from 10/9/2021, 9:34:09 AM

All unhandled elements

  • td (1)
  • tr (1)
  • table.standard-table (1)

Details per Document

Invalid AST transformations

td (126:4) => tableCell