vue-markdown
vue-markdown copied to clipboard
Highlight doesn't work when vue-markdown is called from <router-view/>
When vue-markdown is placec outside of router-view
it works like a charm with highlighting. When the same component is called from within router-view
component the highlighting doesn't apply. I will try to attach a screenshot presenting the effect. It seems to be some kind of race condition related to prism invocation.
I think I've found the answer: https://github.com/PrismJS/prism/issues/907
Prism only runs on DOMContentLoaded and highlights what's there. To highlight any other element, use Prism.highlightElement(). If there are many, use Prism.highlightAll(), but keep in mind that will also go over already highlighted elements and re-highlight them.