Tony Brix
Tony Brix
Looks like it is not documented anywhere either. https://github.com/github/markup/issues/1326
It might be nice to use the unicode library to create the regexps like https://github.com/Flet/github-slugger/pull/35. We would have to watch how much that adds to the minified file size.
This is a bug but you can fix it by escaping the bars. [demo](https://marked.js.org/demo/?text=%0A%0A%7C**Meaning**%7CMain%20axis%7C%0A%7C---%7C---%7C%0A%7C**Values**%7C%60row%20%5C%7C%20row-reverse%20%5C%7C%20column%20%5C%7C%20column-reverse%60%7C&options=%7B%0A%20%22baseUrl%22%3A%20null%2C%0A%20%22breaks%22%3A%20false%2C%0A%20%22gfm%22%3A%20true%2C%0A%20%22headerIds%22%3A%20true%2C%0A%20%22headerPrefix%22%3A%20%22%22%2C%0A%20%22highlight%22%3A%20null%2C%0A%20%22langPrefix%22%3A%20%22language-%22%2C%0A%20%22mangle%22%3A%20true%2C%0A%20%22pedantic%22%3A%20false%2C%0A%20%22sanitize%22%3A%20false%2C%0A%20%22sanitizer%22%3A%20null%2C%0A%20%22silent%22%3A%20false%2C%0A%20%22smartLists%22%3A%20false%2C%0A%20%22smartypants%22%3A%20false%2C%0A%20%22tables%22%3A%20true%2C%0A%20%22xhtml%22%3A%20false%0A%7D) PRs are welcome 😃
> If we create `.md` file in the first place, things work as expected. But when we change the extension of an existing HTML file to `.md`, first line breaks....
> We can probably filter it out in the start of the Lexer. I would rather not automatically remove or replace anything more unless there is a reason to believe...
I don't believe we use any look-behinds. That would be doable ```js marked.lex(` # heading [**bold** *text*](link.html) `); ``` will return tokens like: ```js [ {type:"heading", raw:"# heading\n\n", depth:1, text:"heading",...
No the position is not saved but could be figured out from the `raw` text. It is a little difficult because some text is converted right away (like `\r\n` to...
Once marked parses the markdown into tokens it should be pretty easy to parse the raw of each token with regexps to change it into highlight.js tokens. I'll try to...
since we replace some things before tokenization it wouldn't be possible to get a complete byte for byte transformation but I think we can get close enough for the result...
the browser doesn't distinguish between tabs and spaces anyway and since the goal of highlight.js is to produce html that should be rendered by a browser I don't know if...