Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Empty Code Block not processed by theme component #9699

Closed
6 of 7 tasks
lebalz opened this issue Jan 4, 2024 · 0 comments · Fixed by #9704
Closed
6 of 7 tasks

Empty Code Block not processed by theme component #9699

lebalz opened this issue Jan 4, 2024 · 0 comments · Fixed by #9704
Labels
bug An error in the Docusaurus core causing instability or issues with its execution

Comments

@lebalz
Copy link
Contributor

lebalz commented Jan 4, 2024

Have you read the Contributing Guidelines on issues?

Prerequisites

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

Description

When using an empty Codeblock (e.g. for a live react playground, that does not have any default code), the code is shown as inline-code instead of a code-block. Therefore the theme-live-codeblock is not applied to this codeblock and the expected "live"-behaviour is not available.

The repro only shows the minimal case, where a normal empty codeblock is displayed as an inline code.

image

Reproducible demo

👉 https://codesandbox.io and checkout /docs/intro

Steps to reproduce

Add an empty codeblock inside a markdown document:

```
```

Expected behavior

The result shall be a codeblock:
image

Actual behavior

An inline codeblock is displayed instead

image

(Adding an empty line to the codeblock does not fix the issue)

Your environment

  • Public source code: 👉 codesandbox.io at #/docs/intro
  • Docusaurus version used: 3.0.1
  • Environment name and version (e.g. Chrome 89, Node.js 16.4): Microsoft Edge Version 120.0.2210.91 (Offizielles Build) (64-Bit)
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS): Windows 11

Self-service

  • I'd be willing to fix this bug myself.
@lebalz lebalz added bug An error in the Docusaurus core causing instability or issues with its execution status: needs triage This issue has not been triaged by maintainers labels Jan 4, 2024
@slorber slorber removed the status: needs triage This issue has not been triaged by maintainers label Jan 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug An error in the Docusaurus core causing instability or issues with its execution
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants