vscode-liquid icon indicating copy to clipboard operation
vscode-liquid copied to clipboard

Comments with Quotes Cause Strange HTML Injection

Open entozoon opened this issue 6 years ago • 2 comments

Input:

<html>
  <head>
    {% comment %}
     apostrophe's
    {% endcomment %}
  </head>
  <body>
  </body>
</html>

Formatted:

<html>
  <head>
    {% comment %}
     apostrophe's
    {% endcomment %}
  </head>
  <body>
  </body>
</html>
  </head>
</html> 

And after every format it injects another..

  </head>
</html>

..every single time!

It appears to only happen when a comment contains an ' apostrophe or " quote, which is quite bizarre :)

entozoon avatar Oct 22 '19 11:10 entozoon

Hey @entozoon I am aware of this and next release will fix this issue. It's actually a PrettyDiff issue but with version 2.4 nearing completion a lot of formatting conflicts and issues (like this) will be instead handled by the extensions parser opposed to PrettyDiff.

Some additional features to come in the next version will be a new and improved way to write comments which takes some minor inspiration from JS Docs.

panoply avatar Oct 27 '19 21:10 panoply

Sounds amazing, great work @panoply . You rule :)

entozoon avatar Oct 28 '19 10:10 entozoon

🚢 Shipped v3.0.0

panoply avatar Sep 28 '22 08:09 panoply