docusaurus icon indicating copy to clipboard operation
docusaurus copied to clipboard

When using commonmark, `<var>` inside of `<code>` results in a codeblock

Open robert-j-webb opened this issue 4 months ago • 9 comments

Have you read the Contributing Guidelines on issues?

Prerequisites

  • [X] I'm using the latest version of Docusaurus.
  • [X] I have tried the npm run clear or yarn clear command.
  • [X] I have tried rm -rf node_modules yarn.lock package-lock.json and re-installing packages.
  • [X] I have tried creating a repro with https://new.docusaurus.io.
  • [X] I have read the console error message carefully (if applicable).

Description

Heres the rerpo of the issue - you can see the demo here

This is the problem code:

# intro.md:

This is <code>inline <var>var</var></code>

Results in

image

However, it should not result in a code block, instead it should still be inline.

Note that if you remove commonmark support by editing docusaurus.config.ts to not have:

    markdown: {
      format: 'detect',
    },

Then it works with inlining.

I know commonmark support is experimental, and I am not expecting a quick fix. I am merely hoping my issue report will help improve support for commonmark when it does work. Thanks a ton for all of your work on this project :)

Self-service

  • [X] I'd be willing to fix this bug myself.

robert-j-webb avatar Sep 27 '24 23:09 robert-j-webb