beautifier/js-beautify
在 GitHub 查看Beautification problem with JS Single Line Comment <!--
Open
#1,835 创建于 2020年8月31日
good first issuelanguage: javascripttype: bug
仓库指标
- Star
- (8,342 star)
- PR 合并指标
- (平均合并 51天 1小时) (30 天内合并 16 个 PR)
描述
In Javascript <!-- is treated as a single-line comment just like //.
js-beautify works as expected when the line starts with <!--:
Input:
<!--alert(1)commented
Output:
<!--alert(1)commented
Otherwise it will break the syntax:
Input:
alert(1)<!--commented
Output:
alert(1) < !--commented