Vim 文档说明了向 HTML 添加注释的“错误方法”。它有什么问题?

Vim 文档说明了向 HTML 添加注释的“错误方法”。它有什么问题?

Vim 官方文档中的“syntax.txt”一章说道:

HTML comments are rather special (see an HTML reference document for the
details), and the syntax coloring scheme will highlight all errors.
However, if you prefer to use the wrong style (starts with <!-- and
ends with --!>) you can define:
        :let html_wrong_comments=1

帮助文本描述了“错误的样式”。但我不明白:样式怎么会“错误”呢?

答案1

在查阅了 Steve Oualline 的 Vim 一书(New Riders Publishing,2001)之后,我明白了答案是什么。

“错误的风格”在结尾附近多了一个感叹号。

<!-- Right style -->
<!-- Wrong style --!>

为什么我第一次阅读帮助文本时没有注意到额外的标记?我想我一定是读得太快了。

我真傻!

相关内容