stumptown-content icon indicating copy to clipboard operation
stumptown-content copied to clipboard

Catch invalid "code syntax highlighting markers"

Open peterbe opened this issue 6 years ago • 1 comments

It's hard to link to a specific line in markdown files in GitHub: https://github.com/mdn/stumptown-content/blob/master/content/html/reference/elements/abbr/docs.md#accessibility-concerns You have to click to view Raw to see what I'm talking about:

``` {.brush: .html}
<p>JavaScript Object Notation (<abbr>JSON</abbr>) is a lightweight data-interchange format.</p>
```

What it should be is:

```html
<p>JavaScript Object Notation (<abbr>JSON</abbr>) is a lightweight data-interchange format.</p>
```

I think this {.brush: .html} is a relic from the Kuma wiki raw content.

This'll happen from time to time and it barfs up the renderer's ability to syntax highlight. The renderer will need to decide that to do if the string there isn't html or css or wasm or something else it can expect.

I thing the best course of action for the renderer is to swallow all such troublemakers, make a console warning, and leave it be. Ideally, in the linters here on the content side, it should clean throw an error.

peterbe avatar Sep 10 '19 00:09 peterbe

I'd love to help with this one. Can someone guide me on how to hook up into the markdown conversion so as to write some code that validates?

peterbe avatar Sep 10 '19 00:09 peterbe