volca / markdown-preview

Markdown Preview Plus -- Enables Chrome to render markdown files as HTML
https://chrome.google.com/webstore/detail/markdown-preview-plus/febilkbfcbhebfnokafefeacimjdckgl
MIT License
237 stars 73 forks source link

MarkedJs breaking API change are unaddressed, rendering fails. #155

Closed zvodd closed 8 months ago

zvodd commented 8 months ago

Viewing a markdown file shows a mostly unformatted text. markdownify.js:L106

TypeError: marked.Slugger is not a constructor

You can see in the MarkedJs repo at some point before commit f45cfc3e2d6082736e7835862cc6deb911218633 the Slugger part of the API has changed.

https://github.com/markedjs/marked/compare/ccc7a8fb3427152d11d24720847c19f355d27e8d...f45cfc3e2d6082736e7835862cc6deb911218633 - click on "Files Changes" to view diff and search Slugger and you can see many deleted lines.

Dug a little deeper and found: https://github.com/markedjs/marked/pull/2984

Looks like they have removed that from version 8 or 9 of MarkedJs, so solution is probably either: reverting MarkedJs to an earlier version, or to reimplement and probably use github-slugger instead as they recommend.

volca commented 8 months ago

Thanks for note. I will look into this later

volca commented 8 months ago

github-slugger is a esm package. It can't work proper with the plugin. So I downgrade marked instead.