os-checker / os-checker.github.io

https://os-checker.github.io
MIT License
0 stars 0 forks source link

Bug: 依然没有处理好 highlightjs 重新高亮和 HTML 转义 #25

Closed zjp-CN closed 1 month ago

zjp-CN commented 1 month ago
CodeBlock.vue:28 One of your code blocks includes unescaped HTML. This is a potentially serious security risk.
CodeBlock.vue:28 https://github.com/highlightjs/highlight.js/wiki/security
CodeBlock.vue:28 The element with unescaped HTML:
CodeBlock.vue:28 <code class="language-diff codeblock hljs" data-highlighted="yes">file: /ci/arceos/tools/deptool/src/cmd_builder.rs (original lines from 6 to 6)
<span class="hljs-deletion">-        false =&gt; "--no-default-features"</span>
<span class="hljs-addition">+        false =&gt; "--no-default-features",</span>
</code>

截图_20240810073100

zjp-CN commented 1 month ago

在 v-for + :key=snip 之后,得到警告 [Vue warn]: Duplicate keys found during update: ...snip...,因此,不能直接把待高亮的字符串作为 key。

zjp-CN commented 1 month ago

暂时移除了 :key,目前应该解决了。