You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When loading and then outputting the html of an HtmlDocument, it will currently either quote all attributes or those that require it (e.g. spaces, line breaks etc.) depending on the value of OptionOutputOptimizeAttributeValues.
There is however no way to control which quote type is used. So if I load a document with quoteless attributes and immediately output it, those attributes are suddenly quoted using double quotes.
Ideally when attributes are read, the current quote type should be set according to what it is in the read html, which would mean a third option of None, in addition to SingleQuotes and DoubleQuotes.
As a less desirable alternative, the ability to change the default quote type at the document level could be added.
We cannot make this behavior as a default one due to backward compatibility but we added an options.
You should now be able to do: htmlDoc.GlobalAttributeValueQuote = AttributeValueQuote.Initial; to keep exactly the quote (or nothing) that has been parsed.
We also added AttributeValueQuote.None that force "no quote" to attribute
Let me know if that's exactly what you were looking for.
That's great. I fully understand the need to keep the default behaviour and an option to change it will serve us just fine.
So I am very pleased with the change, and the speed of it :)
Description
When loading and then outputting the html of an HtmlDocument, it will currently either quote all attributes or those that require it (e.g. spaces, line breaks etc.) depending on the value of OptionOutputOptimizeAttributeValues.
There is however no way to control which quote type is used. So if I load a document with quoteless attributes and immediately output it, those attributes are suddenly quoted using double quotes.
Ideally when attributes are read, the current quote type should be set according to what it is in the read html, which would mean a third option of None, in addition to SingleQuotes and DoubleQuotes.
As a less desirable alternative, the ability to change the default quote type at the document level could be added.
NoQuoteOverride v2.zip
Further technical details
The text was updated successfully, but these errors were encountered: