Skip to content

Feature request: Support for plaintext within inline code and consider plain text as default when no marker is set #123

@stevebeauge

Description

@stevebeauge

I'm trying to move from prismjs to this plugin.

Everything works as expected except for inline code. I often use backticks to highlight some technical keywords.

With prismjs, inline code rendered as code. However, using gatsby-remark-vscode, It doesn't render using VS Theme, only a <code> block is produced.

I'm aware of the inline code with marker syntax, but it has two problems (from my experience):

  1. there's no support for plaintext. Unless I missed something, plaintext is not a available language (though VSCode support this "language"). If I specify either plaintext or text, it won't compile (Cannot destructure property 'tokenTypes' of 'getGrammar(...)' as it is undefined.). As a workaround I specify cmd to produce a neutral color
  2. full marker syntax is overkill for my case, supporting simple backticks should be processed bt this pluging.

For exemple, this markdown :

Basic inline : `inline`

Inline with marker : `cmd•inline`

Basic render

    some code

Renders (styles removed):

<div>
    <p>Basic inline : <code>inline</code></p>
    <p>Inline with marker : <code class="dark-default-dark" data-language="cmd"
            data-index="0"><span class="mtk1">inline</span></code></p>
    <p>Basic render</p>
    <pre class="grvsc-container dark-default-dark" data-language=""
        data-index="0"><code class="grvsc-code"><span class="grvsc-line"><span class="grvsc-source">some code</span></span></code></pre>
    
    
</div>

visually:

image

As you can see, the "simple" backticks renders as a simple non styled code blocks.

I believe that :

  • plaintext should be supported
  • backticks without language marker should be processed using the default theme using the "plaintext" language

Did I missed something ? Is there a chance to enhance thise behavior ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions