gpt4 book ai didi

reactjs - 转义 "import"和 react/html 以在 MDX 中显示为文本?

转载 作者:行者123 更新时间:2023-12-05 06:18:39 24 4
gpt4 key购买 nike

我刚开始在 gatsby/react 中使用 MDX,我希望能够转义内容以显示为普通文本,即

例如,我想将其显示为标准文本?

here is some info

import {test} from "test"

ffdg

<text>dddd</text>

导入行在 Playground 上提示(https://mdxjs.com/playground/)但是如果我用空格开始它似乎没问题

但是以 HTML 尖括号开头的行,空格没有帮助。我用刻度线包围了它,但随后它呈现为灰色背景。

转义或告诉 MDX 忽略某些内容的正确方法是什么?

有人知道吗

最佳答案

用```包裹一切

```
here is some info

import {test} from "test"

ffdg

<text>dddd</text>
```

关于reactjs - 转义 "import"和 react/html 以在 MDX 中显示为文本?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61188612/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com