简体   繁体   English

CodeMirror:实体在HTML模式下变成了HTML标签

[英]CodeMirror: Entities turned into HTML tag in HTML mode

When specifying for example a line of HTML as follows: 例如,当指定一行HTML时,如下所示:

<dt><code>&lt;dl&gt;</code></dt>

CodeMirror will convert the entities to their tag equivalent ie CodeMirror会将实体转换为等效的标签,即

<dt><code><dl></code></dt>

NOTE: This is when CodeMirror is initialised and the first passed as the initial editor content. 注意:这是初始化Code​​Mirror并首次将其作为初始编辑器内容传递的时间。 So it does not happen as you type. 因此,键入时不会发生这种情况。

Is there a way to prevent this from happening? 有办法防止这种情况发生吗? Perhaps a config, plugin, or custom function. 也许是配置,插件或自定义功能。 I have looked over the documentation and does not look like there is anything. 我查看了文档,但看起来没有任何东西。 Thank you in advance 先感谢您

这不是CodeMirror引起的,而是浏览器在将内容发送到编辑器之前进行了解析:-/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM