我在解析从API得到的html时遇到了一些问题。我尝试过dangerouslySetInnerHTML、react-html-parser和html-react-parser。这三个函数都可以工作,但这三个函数在
example of the href parsing issue
来自API的html对我来说看起来很好,尽管我经验不是很丰富:
Bitcoin uses the <a href=\"https://www.coingecko.com/en?hashing_algorithm=SHA-256\">SHA-256</a> hashing algorithm with an average transaction confirmation time of 10 minutes.
有谁遇到过类似的问题吗?谢谢
发布于 2021-10-20 21:41:03
希望可以回答我自己的问题:多亏了Daniel Beck的提示,我才能解决这个问题。解析器将文本转换为对象数组,其中常规文本是字符串,锚标记是对象。我的容器有display: flex和flex-direction: column,这就是为什么链接会出现在单独的一行中。谢谢
https://stackoverflow.com/questions/69650752
复制相似问题