gridsome-plugin-remark-shiki icon indicating copy to clipboard operation
gridsome-plugin-remark-shiki copied to clipboard

Code block don't get highlighted

Open rasulkireev opened this issue 5 years ago • 8 comments

Hey all,

I am running into an issue where my code blocks are not highlighted, based on the language choses in my code lock. They are all plain white. Tried everything, not sure what to do, would love if someone took a look. Thanks a ton in advance.

I use vue-remark:

gridsome.config.js

module.exports = {
    ...
    plugins: [
        {
            use: '@gridsome/vue-remark',
            options: {
                typeName: 'Post',
                path: 'content/articles/*.md',
                baseDir: './content/articles',
                route: '/:slug',
                template: './src/templates/Post.vue',
                plugins: [
                    ['gridsome-plugin-remark-shiki', { skipInline: true, theme: 'min-dark' }],
                    ['@noxify/gridsome-plugin-remark-embed', {
                        'enabledProviders' : ['Youtube', 'Twitter', 'Gist'],
                    }]
                ],
            },
        },
    ],
    ...
}

Post.vue

<!-- Tailwind for styling -->
<VueRemarkContent class="prose-sm prose md:prose-2xl"></VueRemarkContent>

.md file

\```python
%matplotlib inline

# Standard Libraries to import
import pandas as pd
import matplotlib.pyplot as plt
import numpy as np

dataset = pd.read_csv('data/processed/clean_dataset.csv', index_col=0)
\```

and this is the result: image

rasulkireev avatar Aug 10 '20 18:08 rasulkireev

Don't escape code fences. Remove \ and things should work fine.

naiyerasif avatar Aug 15 '20 09:08 naiyerasif

@naiyerasif ,

I don't use the \ in my code. Added here to escape the bacticks.

rasulkireev avatar Aug 17 '20 05:08 rasulkireev

I have the same issue.. Prism doesn't seem to work either.

itsnwa avatar Oct 07 '20 13:10 itsnwa

Its about usage with VueRemark right ?

Does one of you affected have a public repo with that issue that I could take a look at ?

EldoranDev avatar Oct 08 '20 19:10 EldoranDev

This is my repo -> https://github.com/rasulkireev/gridsome-personal-webite

Thanks for looking into this @EldoranDev

rasulkireev avatar Oct 08 '20 20:10 rasulkireev

Have the exact same issue.

philippkuehn avatar Oct 29 '20 09:10 philippkuehn

@EldoranDev, understand that you have a ton of things going on, so not pushing, just wanted to ask: Did you get the chance to look at the issue?

rasulkireev avatar Mar 15 '21 19:03 rasulkireev

I was doing more research, and I should probably mention that I am also using TailwindCSS via the gridsome-plugin-tailwindcss. I think the issue is that Tailwind config somehow overwrites Shiki styles.

I was able to bypass the issue with this plugin.

rasulkireev avatar Mar 16 '21 05:03 rasulkireev