Skip to content

Feed generation warns: "Received true for a non-boolean attribute" when using {2,3} highlighting #6195

Description

@KELEN

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

the new version is 2.0.0-beta.14

```jsx {2,3}
const a = 123;

return {
  a: 1
}
```
Warning: Received `true` for a non-boolean attribute `{2,3}`.

If you want to write it to the DOM, pass a string instead: {2,3}="true" or {2,3}={value.toString()}.
    at code
    at D:\github\website\node_modules\@mdx-js\react\dist\cjs.js:153:30

Steps to reproduce

when use highlight code,eg: {2, 3}

npm run build,throw warning

Expected behavior

No warning show

Actual behavior

Warning: Received true for a non-boolean attribute {2,3}.

Your environment

  • Public source code:
  • Public site URL:
  • Docusaurus version used:
  • Environment name and version (e.g. Chrome 89, Node.js 16.4):
  • Operating system and version (e.g. Ubuntu 20.04.2 LTS):

Reproducible demo

No response

Self-service

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error in the Docusaurus core causing instability or issues with its execution

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions