vue-remark issues with remark plugins
See original GitHub issueDescription
I tried replacing the @gridsome/source-filesystem with the new @gridsome/vue-remark, but ran into issues with remark plugins. When using the @gridsome/vue-remark with @gridsome/remark-prismjs the prism plugin is not working (not tokenizing the html output to apply styling to).
Steps to reproduce
In gridsome.config.js
module.exports = {
plugins: [
{
// Create posts from markdown files
use: "@gridsome/vue-remark",
options: {
typeName: "Post",
path: "content/posts/*.md",
baseDir: "./content/posts",
template: "./src/templates/Post.vue",
remark: {
plugins: ["@gridsome/remark-prismjs"]
}
}
},
],
transformers: {
remark: {
plugins: ["@gridsome/remark-prismjs"]
}
}
};
Expected result
The prism plugin should add additional token classes to the html generated when using code blocks in markdown.
Actual result
The actual html looks like this (no tokenized output):
<pre><code class="language-css">
.test {
background: none;
}
</code></pre>
Environment
Libs:
- gridsome version: 0.7.5
- @gridsome/cli version: 0.2.3
For Tooling issues:
- Node version: 11.14.0
- Platform: Windows
Issue Analytics
- State:
- Created 4 years ago
- Reactions:1
- Comments:18 (4 by maintainers)
Top Results From Across the Web
gridsome/vue-remark
Insert the <VueRemarkContent> component where you want to show the Markdown content. module.exports = { plugins: [ { use: '@gridsome/vue-remark', ...
Read more >How To add Code Highlighting To Gridsome Using Prismjs
This is a guide on how to enable or add code syntax highlighting to a gridsome blog using the prisimjs via the @gridsome/remark-prismjs...
Read more >Creating blog post images automatically for Gridsome
Vue-Remark plugin config. The important part of the configuration for generating blog cover images is the typeName - for more details on configuring...
Read more >@gridsome/vue-remark examples - CodeSandbox
Learn how to use @gridsome/vue-remark by viewing and forking @gridsome/vue-remark example apps on CodeSandbox.
Read more >vue-remark - npm Package Health Analysis | Snyk
While scanning the latest version of vue-remark, we found that a security review is needed. A total of 1 vulnerabilities or license issues...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@danrocha I tested your repository now and it seems to work as expected 😃
Here is what I did:
transformers
config fromgridsome.config.js
plugins
option on each@gridsome/vue-remark
entry## Table of Contents
heading after the import statement in./content/blog/magic-hours-will-make-photography-shine.md
And I got a nested list containing all headings below. Can you try the same and see if it works?
Hey @sebastianluszczek, I cloned your repository and your configuration worked after I made a change in the markdown file. Just be sure to edit the markdown file while in
gridsome develop
, else it will use an older cached version. I don’t know why it works like this, this is probably an additional bug worthy to report?Config:
Generated HTML: