beautifier/js-beautify

Beautification problem with JS Single Line Comment <!--

Open

#1.835 aberto em 31 de ago. de 2020

Ver no GitHub
 (9 comments) (0 reactions) (1 assignee)JavaScript (8.342 stars) (1.460 forks)batch import
good first issuelanguage: javascripttype: bug

Description

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

Guia do colaborador