markdown-it-loader icon indicating copy to clipboard operation
markdown-it-loader copied to clipboard

List hightlight.js as optional peer dependency, for people that use prism instead

Open dietergeerts opened this issue 7 years ago • 1 comments

I like prism more, especially their themes, but when using markdown-it-prism, and thus removing highlight.js, beause I don't use it, there still is an error that it can't be found. It would be better if the loader will only use it if it's there, and otherwise doesn't use highlight.js, so in a sense, it would be an optional peer dependency. Currently it's confusing to see both prism and highlight.js in de dependency list.

dietergeerts avatar Jul 07 '18 16:07 dietergeerts

Agreed. I'm just not interested in the highlighting, and it seemed a bit silly to be forced to add it to my dependency lists.

Should be easy to fix with a try-catch around the import and just return an empty string from the default highlight function in that case.

franklin-ross avatar Feb 07 '19 06:02 franklin-ross