JanGuillermo / vue3-markdown-it

✨ An awesome Vue 3 markdown-it wrapper plugin that can even support external plugins!
MIT License
238 stars 29 forks source link

How to active highlight plugin? #183

Open vincentcordel opened 3 years ago

vincentcordel commented 3 years ago

I know it's a basic question but I can't figure out how to use the highlight plugin? Where am I supposed to declare it and do I need to install something else?

Can you provide an example? Thank you!

pscheffer commented 2 years ago

@musixite probably way too late for this but I just came up against this same problem. Following the text in the readme, importing only a highlight js css file makes it work for me.

yarn add hightlight.js
// somewhere in javascript (I added to my app initialization file):
import 'highlight.js/styles/github-dark-dimmed.css'

then in my component file, I am simply using the Markdown component and highlighter is styled: Screen Shot 2022-03-21 at 3 24 46 PM

i have not yet tried using the highlighter prop on the component. I am guessing thats to pass the highlight.js options listed here: https://github.com/valeriangalliat/markdown-it-highlightjs#usage