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

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

描述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:

import { Meta, Markdown } from '@storybook/addon-docs';
import Readme from './MyReadme.md?raw';

<Meta title="Issue/MyReadme" />

<Markdown>{Readme}</Markdown>

MyReadme.md

This should show a unicode checkbox in a table:

| Checked?    | Character |
| ------------| --------- |
| No          | &#9744;   |
| Yes         | &#9745;   |

This should show a unicode character outside of the table: &#9745;

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.

系统信息

Environment Info:

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

其他上下文

  • 无响应*
t2a7ltrp

t2a7ltrp1#

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

相关问题