Closed Kolibarus closed 2 years ago
Yes, I'd say this is a fix / improvement for the HTML markup formatter, which should choose a better representation here. The CSS stringification does not (need to) know where it's result should be used.
How about making IMarkupFormatter as DI for BrowsingContext or at least make HtmlMarkupFormatter.Instance not readonly?
I saw chrome does the same...
$0.style.fontFamily="'bbb ccc'"
creates
'<div style="font-family: "bbb ccc";"></div>'
I think it would be a problem if this gets also converted:
div::before { content: "\'" }
==> but after a test this seems to be correct
Reproducе:
Single quotes in CSS font-family are becoming double due to the fact that the Core CssString() method is used in the class Label.
https://github.com/AngleSharp/AngleSharp.Css/blob/4cccb13447da93e962632582f8526ae1b760780e/src/AngleSharp.Css/Values/Primitives/Label.cs#L40
Core CSString() frames a string
Times New Roman
with double quotes, which then turn into"Times New Roman"
in HtmlMarkupFormatter: https://github.com/AngleSharp/AngleSharp/blob/33f8826f93be863170a125c50048e1f07e3176a6/src/AngleSharp/Html/HtmlMarkupFormatter.cs#L140