Skip to content

[Bug] react-markdown引入remark-directive插件后,渲染报错 #203

Open
@zhghg

Description

💻 系统环境 | Operating System

Windows

🌐 浏览器 | Browser

Chrome

🐛 问题描述 | Bug Description

import remarkDirective from 'remark-directive';

const content = `
:::alert{aaa="123"}
这是内容
:::

`
<Markdown
  remarkPlugins={[[remarkDirective]]}>
  {content}
</Markdown>

使用{}包裹属性时,会报Cannot set properties of undefined (setting 'directiveAttributes'),直接使用react-markdown 9.0.1版本没有此问题,但如果强行覆盖使用9.0.1版本,code就无法渲染了。

🚦 期望结果 | Expected Behavior

No response

📷 复现步骤 | Recurrence Steps

No response

📝 补充信息 | Additional Information

No response

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions