beautifier/js-beautify

Beautification problem with JS Single Line Comment <!--

Aperta

#1835 aperta il 31 ago 2020

 (10 commenti) (0 reazioni) (1 assegnatario)JavaScript (1460 fork)batch import
good first issuelanguage: javascripttype: bug

Metriche repository

Star
 (8342 stelle)
Metriche merge PR
 (Metriche PR in attesa)

Descrizione

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

Guida contributor