首页 > 解决方案 > 如何从字符串中渲染reactjs中的数学类型标签?

问题描述

所以,我正在尝试使用react-html-parser. 它能够呈现普通的 html,但不能呈现数学类型的标签。

有没有一个插件可以渲染它们。

以下是我的包含这两个内容的字符串。

"<p>Math test<br />↵&lt;math xmlns="http://www.w3.org/1998/Math/MathML"><msqrt><mn>25</mn></msqrt></math>&nbsp;<math xmlns="http://www.w3.org/1998/Math/MathML"><msup><mn>2</mn><mn>3</mn></msup></math>&nbsp;&nbsp;<math xmlns="http://www.w3.org/1998/Math/MathML"><mo>&#8746;</mo><mn>2</mn></math>&nbsp;</p>↵"

谢谢。

标签: reactjsmathtype

解决方案


推荐阅读