pugjs/pug

Escaping fails with Unescaped String Interpolation

figurnov opened this issue · 3 comments

Pug Version: 3.0.2

Node Version: 18.16.0

Input Pug

\!{unescaped string}

Expected HTML

!{unescaped string}

Actual HTML

#{unescaped string}

Additional Comments

Pug:

p Escaping works with \#{Escaped String Interpolation}.
p It works with \#[Tag Interpolation] too!
p But it fails with \!{Unescaped String Interpolation}. 

HTML:

<p>Escaping works with #{Escaped String Interpolation}.</p>
<p>It works with #[Tag Interpolation] too!</p>
<p>But it fails with #{Unescaped String Interpolation}. </p>

Working on it.

Issue not exist.

- var msg = "not my inside voice";
p This is \!{msg.toUpperCase()}

compiled to

<p>This is !{msg.toUpperCase()}</p>

Indeed, in Pug 3.0.2, the problem is not observed. Thank you very much.
It turned out that Pug 2.0.4 was called in incorrectly compiled examples

Along the way, it turned out that almost all available online converters from Pug to HTML use the old version of Pug, in which the described problem is observed. For example:

And here are the online converters with the correct compilation result: