EldoranDev / gridsome-plugin-remark-shiki

Syntax highlighter for markdown code blocks using shiki
15 stars 8 forks source link

Code block don't get highlighted #18

Open rasulkireev opened 4 years ago

rasulkireev commented 4 years ago

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
naiyerasif commented 4 years ago

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

rasulkireev commented 4 years ago

@naiyerasif ,

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

itsnwa commented 3 years ago

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

EldoranDev commented 3 years ago

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 ?

rasulkireev commented 3 years ago

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

Thanks for looking into this @EldoranDev

philippkuehn commented 3 years ago

Have the exact same issue.

rasulkireev commented 3 years ago

@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 commented 3 years ago

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.