jnordberg / wintersmith

A flexible static site generator
http://wintersmith.io/
MIT License
3.5k stars 332 forks source link

marked upgrade from 0.3.x to 0.5.x changed how markdown inside html is parsed #340

Open city41 opened 5 years ago

city41 commented 5 years ago

The recent-ish upgrade from marked 0.3.12 to 0.5.1 changed how markdown inside html is parsed.

I have html like this in my markdown files

## The series
<ul>
    <li>[part one: basic rendering](/articles/react-internals-part-one-basic-rendering)</li>
    <li>[part two: componentWillMount and componentDidMount](/articles/react-internals-part-two-componentWillMount-and-componentDidMount/)</li>
    <li>[part three: basic updating](/articles/react-internals-part-three-basic-updating)</li>
    <li>[part four: setState](/articles/react-internals-part-four-setState)</li>
    <li>**part five: transactions** <- you are here</li>
</ul>

With marked 0.3.12, it would parse the embedded markdown into html. Now it leaves it as is. Arguably the new behavior is more correct, but this should constitute a breaking change IMO.

I worked around this by installing marked@0.3.12 locally and forcing wintersmith to use it (with yarn you can add resolutions to your package.json file, or with npm you need to use npm-force-resolutions package.

city41 commented 5 years ago

It looks like the marked team considers this a bug: https://github.com/markedjs/marked/issues/985

Perhaps when they fix it, wintersmith could grab the fix.