fix(html/codegen): Fix quotes in attributes (#4918)

This commit is contained in:
Alexander Akait 2022-06-10 06:54:04 +03:00 committed by GitHub
parent a0f643777f
commit 064e50448f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 83 additions and 2 deletions

View File

@ -857,9 +857,9 @@ fn minify_attribute_value(value: &str) -> String {
}
if dq > sq {
format!("'{}'", minified)
format!("'{}'", minified.replace('\'', "'"))
} else {
format!("\"{}\"", minified)
format!("\"{}\"", minified.replace('"', """))
}
}

View File

@ -150,5 +150,32 @@ __ bind(&current);
&amposlash; &amposLash; &ampOslash;
</div>
<a b=`'&apos;<<==/`/></a>
<a b=`'&quot;<<==/`/></a>
<a b=`'"<<==/`/></a>
<a b=`'"""<<==/`/></a>
<a b='`"<<==/`/'></a>
<a b="`'<<==/`/"></a>
<a b="&quot;"></a>
<a b="&apos;"></a>
<a b='&apos;'></a>
<a b='&quot;'></a>
<a b='&apos;&apos;&apos;'></a>
<a b="&apos;&apos;&apos;"></a>
<a b='&quot;&quot;&quot;'></a>
<a b="&quot;&quot;&quot;"></a>
<a href=">"></a>
<a href="<"></a>
<a href="&lt;"></a>
<a href="&lt"></a>
<a href="&gt;"></a>
<a href="&gt"></a>
<a href="&#62;"></a>
<a href="&#62"></a>
</body>
</html>

View File

@ -146,6 +146,33 @@ __ bind(&amp;current);
&amp;oslash; &amp;osLash; &amp;Oslash;
</div>
<a b="`''<<==/`/"></a>
<a b="`'&quot;<<==/`/"></a>
<a b="`'&quot;<<==/`/"></a>
<a b="`'&quot;&quot;&quot;<<==/`/"></a>
<a b="`&quot;<<==/`/"></a>
<a b="`'<<==/`/"></a>
<a b="&quot;"></a>
<a b="'"></a>
<a b="'"></a>
<a b="&quot;"></a>
<a b="'''"></a>
<a b="'''"></a>
<a b="&quot;&quot;&quot;"></a>
<a b="&quot;&quot;&quot;"></a>
<a href=">"></a>
<a href="<"></a>
<a href="<"></a>
<a href="<"></a>
<a href=">"></a>
<a href=">"></a>
<a href=">"></a>
<a href=">"></a>
</body></html>

View File

@ -144,5 +144,32 @@ __ bind(&amp;current);
&amp;oslash; &osLash; &amp;Oslash;
</div>
<a b="`''<<==/`/"></a>
<a b="`'&quot;<<==/`/"></a>
<a b="`'&quot;<<==/`/"></a>
<a b='`&apos;"""<<==/`/'></a>
<a b='`"<<==/`/'></a>
<a b="`'<<==/`/"></a>
<a b='"'></a>
<a b="'"></a>
<a b="'"></a>
<a b='"'></a>
<a b="'''"></a>
<a b="'''"></a>
<a b='"""'></a>
<a b='"""'></a>
<a href=">"></a>
<a href="<"></a>
<a href="<"></a>
<a href="<"></a>
<a href=">"></a>
<a href=">"></a>
<a href=">"></a>
<a href=">"></a>