all repos — htmlformat @ 70632419c23cf7ac43a3be5b163e8482ae8dcc45

Go package and CLI tool used to format HTML

fix unescaping of html entities in <code> tags

Alin
commit

70632419c23cf7ac43a3be5b163e8482ae8dcc45

parent

09c6d471f34326c8631ebcc204beb3e1e702f1d0

1 file changed, 6 insertions(+), 0 deletions(-)

changed files
M format_test.goformat_test.go
@@ -135,6 +135,12 @@ expected: `<pre>
<code>const html = &#34;&lt;div class=&#34;test&#34;&gt;Hello &amp; goodbye&lt;/div&gt;&#34;;</code></pre> `, }, + { + name: "HTML entities in code blocks (no pre) are preserved", + input: `<code>const html = "&lt;div class=&quot;test&quot;&gt;Hello &amp; goodbye&lt;/div&gt;";</code>`, + expected: `<code>const html = &#34;&lt;div class=&#34;test&#34;&gt;Hello &amp; goodbye&lt;/div&gt;&#34;;</code> +`, + }, } for _, test := range tests {