Closed opichon closed 7 years ago
After reading the prism docs, I realize that it's prism that adds this class to the <pre>
element., not the markdown parser.
I've managed to make this work by adding this method to the component:
updated() {
Prism.highlightAll();
},
Here's my component (a blog post).
The
post.content
property contains the post's content in markdown format. It gets retrieved via an api call (not documented here, but irrelevant to this discussion).As a side point, this markup does not work:
The post content contains code blocks. These get rendered partially only, like this:
As you can see, the
<pre>
element lacks theclass="language-php"
attribute. As a result, the code block does not get style properly by prism.