storybook [Bug]:在< Markdown>中未渲染Unicode字符

kmbjn2e3  于 8个月前  发布在  其他
关注(0)|答案(1)|浏览(81)

描述bug

在7.0.2版本中,使用Markdown组件导入.MD文件时,在storybook中显示时无法渲染unicode字符。
https://storybook.js.org/docs/react/api/doc-block-markdown#markdown
注意:我没有使用github的markdown插件,通过根据需要使用方括号和x来解决这个问题。

重现问题

克隆7.0.2版本的沙盒,添加以下两个文件:
MyReadme.stories.mdx:

  1. import { Meta, Markdown } from '@storybook/addon-docs';
  2. import Readme from './MyReadme.md?raw';
  3. <Meta title="Issue/MyReadme" />
  4. <Markdown>{Readme}</Markdown>

MyReadme.md

  1. This should show a unicode checkbox in a table:
  2. | Checked? | Character |
  3. | ------------| --------- |
  4. | No | &#9744; |
  5. | Yes | &#9745; |
  6. This should show a unicode character outside of the table: &#9745;
  7. This was working with the previous mdx 1 implementation, and I've confirmed that is the correct setup for unicode characters according to markdown docs, it also works in other viewers I have tried using.

系统信息

  1. Environment Info:
  2. System:
  3. OS: Windows 10 10.0.19045
  4. CPU: (8) x64 11th Gen Intel(R) Core(TM) i7-1165G7 @ 2.80GHz
  5. Binaries:
  6. Node: 16.18.0 - C:\Program Files\nodejs\node.EXE
  7. Yarn: 1.22.15 - C:\Program Files (x86)\Yarn\bin\yarn.CMD
  8. npm: 8.19.2 - C:\Program Files\nodejs\npm.CMD
  9. Browsers:
  10. Edge: Spartan (44.19041.1266.0), Chromium (112.0.1722.39)

其他上下文

  • 无响应*
t2a7ltrp

t2a7ltrp1#

你好,@shilman。我可以尝试修复这个问题吗?

相关问题