beautifier/js-beautify

Beautification problem with JS Single Line Comment <!--

Open

#1,835 创建于 2020年8月31日

在 GitHub 查看
 (9 评论) (0 反应) (1 负责人)JavaScript (8,342 star) (1,460 fork)batch import
good first issuelanguage: javascripttype: bug

描述

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

贡献者指南

Beautification problem with JS Single Line Comment <!-- · beautifier/js-beautify#1835 | Good First Issue