-
Notifications
You must be signed in to change notification settings - Fork 8
Description
When generating HTML, markdown articles have their first # heading extracted via regex, then the raw content is used as the <title>.
This is fine until that heading has some kind of markup, because that element is supposed to be plaintext. This leads to some busted titles showing in browser tabs.
This wouldn’t be too bad if the markup involved was Markdown, but there's a defect in MarkdownJ: it doesn't parse the heading for markup. (Or, at very least, it doesn't recognize backticks to denote code spans.) And we want some formatting in there, particularly code spans to denote commands, bindings, etc.
In some articles we work around this by authoring HTML tags, and then we get tab titles like About the <code>fusion</code> CLI.
A reasonable fix would be to eliminate HTML from the .md content by fixing the markdown layer to handle backticks as expected. We'd have backticks in the tab titles, but that's not too bad.
A better fix would eliminate all markup from the extracted titles.
Long term, we should have declarative page metadata like Jekyll, where we could explicitly declare page titles.