beautifier/js-beautify

Beautification problem with JS Single Line Comment <!--

Open

#1.835 geöffnet am 31. Aug. 2020

Auf GitHub ansehen
 (9 Kommentare) (0 Reaktionen) (1 zugewiesene Person)JavaScript (8.342 Stars) (1.460 Forks)batch import
good first issuelanguage: javascripttype: bug

Beschreibung

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

Contributor Guide