TypeScript:如何使用特殊代码将字符串解码为html?
下面是一个示例字符串,我想解码特殊字符:TypeScript:如何使用特殊代码将字符串解码为html?,typescript,html-encode,Typescript,Html Encode,下面是一个示例字符串,我想解码特殊字符: "<div class="c1-snippet"> Let’s see if you can run Troubleshooter. Select the <strong>Start</strong> button, select <strong>Settings</strong> &g
"<div class="c1-snippet">
Let’s see if you can run Troubleshooter. Select the <strong>Start</strong> button,
select <strong>Settings</strong> > <strong>Update &amp; security</strong>
</div>"
我尝试了“react render html”中的renderHTML,或者使用一次或两次,这只是渲染未渲染的部分
Troubleshooter.
Select the <strong>Start</strong> button,
select <strong>Settings</strong> >
<strong>Update & security</strong> > <strong>Activation</strong>
安装以下软件包: 在模块中导入它 这样使用:
{{ someStringToBeEscaped | escape }}
{{ someStringToBeUnescaped | unescape }}
是的,我用js htmlencode中的htmlDecode解决了这个问题