Comments (8)
+ import rehypeRaw from "rehype-raw";
<ReactMarkdown
children={this.state.storeMd[this.props.id]}
linkTarget="_blank"
remarkPlugins={[gfm]}
+ rehypePlugins={[rehypeRaw]}
components={Highlighter(this.props.dark as boolean)}
/>
如果是 typescript 报错的话,用我最新的代码试试?我刚升级了一下依赖。
from playground-macos.
我用了 react-markdown 来渲染 Markdown,它默认会忽视掉 Markdown 里的 HTML(为了安全性)。但如果想支持 HTML 语法的话,参考它的文档装一个插件 rehype-raw
和修改下面这段代码就可以了:
playground-macos/src/components/apps/Bear.tsx
Lines 206 to 211 in b7f0bd0
因为我目前没有这个需求,同时考虑到打包大小,我暂时应该不会装这个插件,非常感谢。
from playground-macos.
我昨天尝试在react-markdown
中加入rehype-raw
插件,但是渲染失败了,可能是方式不太对。我会去尝试解决它,感谢您的回复😄️那我把这个issues关了,自己研究一下加进去
from playground-macos.
我刚试了一下是可以的 😂,有什么报错吗?
from playground-macos.
😄️可以把相关代码帖一下吗大佬,我react不是特别熟悉,可能也是代码写错了哈哈
from playground-macos.
remarkPlugins={[gfm]}
rehypePlugins={[rehypeRaw]}
而我自己一开始是这样子的
remarkPlugins={[gfm,rehypeRaw]}
我以为这里是个数组,受教了哈哈
from playground-macos.
我以为这里是个数组,受教了哈哈
这的确是个数组,但这俩 props 不一样啊,一个是 remarkPlugins
一个是 rehypePlugins
,所以得分开传 😂
from playground-macos.
这的确是个数组,但这俩 props 不一样啊,一个是
remarkPlugins
一个是rehypePlugins
,所以得分开传 😂
感谢大佬哈哈,这模板真的太炫酷了👍,情不自禁的加了很多乱七八糟的东西上去
from playground-macos.
Related Issues (20)
- I just wanted to say how awesome this is HOT 2
- How to rename username in login screen? HOT 2
- 太酷了! HOT 6
- renaming the tab HOT 8
- [Not an issue] This is pure awesomeness! HOT 1
- Blocked Google Analytics Crashing Whole Page HOT 1
- How to change it's content to ours HOT 1
- app内文字模糊 HOT 8
- 请问登录页面能实现输入密码访问吗 HOT 2
- 无法打开示例页面 HOT 2
- Failed to compile 编译好像有点问题 HOT 2
- 2
- my issiue is how dope this is
- Not able to deploy to heroku or github pages HOT 1
- Index.html showing a blank page
- issue1
- Hi. Why not make a right-click menu
- 希望Launchpad内添加应用app而不仅是链接link
- Can't go deeper... HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from playground-macos.