1

我有以下降价:

> Acronis True Image does not allow to clone a single partition; only cloning of an entire disk is possible
> [Acronis True Image: how to clone a disk | Knowledge Base](https://kb.acronis.com/content/56634)

But you can use <a href="https://px.a8.net/svt/ejp?a8mat=3H7MDC+20NGN6+49QG+5YJRM" rel="nofollow">this</a><img border="0" width="1" height="1" src="https://www11.a8.net/0.gif?a8mat=3H7MDC+20NGN6+49QG+5YJRM" alt="">. 

markdown-it 呈现这样的:

<blockquote>
<p>Acronis True Image does not allow to clone a single partition; only cloning of an entire disk is possible    
<a href="https://kb.acronis.com/content/56634">Acronis True Image: how to clone a disk | Knowledge Base</a></p> 
</blockquote>
<p>But you can use &lt;a href=&quot;https://px.a8.net/svt/ejp?a8mat=3H7MDC+20NGN6+49QG+5YJRM&quot; rel=&quot;nofollow&quot;&gt;this&lt;/a&gt;&lt;img border=&quot;0&quot; width=&quot;1&quot; height=&quot;1&quot; src=&quot;https://www11.a8.net/0.gif?a8mat=3H7MDC+20NGN6+49QG+5YJRM&quot; alt=&quot;&quot;&gt;.</p>

但实际上我想把它渲染成这样的东西:

<blockquote>
<p>Acronis True Image does not allow to clone a single partition; only cloning of an entire disk is possible    
<a href="https://kb.acronis.com/content/56634">Acronis True Image: how to clone a disk | Knowledge Base</a></p> 
</blockquote>
<p>But you can use <a href="https://px.a8.net/svt/ejp?a8mat=3H7MDC+20NGN6+49QG+5YJRM" rel="nofollow">this</a><img border="0" width="1" height="1" src="https://www11.a8.net/0.gif?a8mat=3H7MDC+20NGN6+49QG+5YJRM" alt="">.</p>

我怎样才能做到这一点?

4

1 回答 1

0

您需要启用该html选项:

var md = require('markdown-it')({
  html: true,
});

如所记录的,html默认情况下是禁用的,这解释了为什么它被转义。

选项:

  • html - false. 设置true为在源代码中启用 HTML 标签。当心!那不安全!您可能需要外部消毒剂来保护输出免受 XSS 攻击。最好通过插件扩展功能,而不是启用 HTML。
于 2021-03-08T14:13:55.113 回答