-
-
Notifications
You must be signed in to change notification settings - Fork 395
Description
| _currentattribute.InternalQuoteType = AttributeValueQuote.WithoutValue; |
1. Description
Since version v1.11.62, when the InternalQuoteType was introduced, I have noticed some unwanted changes in my conversions because it mixes the behavior of the QuoteType and WithoutValue in the attributes.
I'm my case I want to set the document to consider the Inicial QuoteType (the default, I believe) to maintain the original QuoteType and also set it to convert to an empty attribute (att=""). Supustly, converting to an empty attribute was the expected behavior but that isn't happening. Setting the GlobalAttributeValueQuote to Inicial the behavior is the same.
Example:
<bar ng-app class='message'></bar>
Actual:
<bar ng-app class='message'></bar>
Expected:
<bar ng-app="" class='message'></bar>
UT with default configs:
[Fact]
public void PreserveEmptyAttributesWithInitialTest()
{
var d = new HtmlDocument();
d.LoadHtml("<bar ng-app class='message'></bar>");
var node = d.DocumentNode.SelectSingleNode("//bar");
var outer = node.OuterHtml;
Assert.Equal("<bar ng-app=\"\" class='message'></bar>", outer);
}
My suggestions:
-
Considering by default that setting the GlobalAttributeValueQuote to Initial will set the isWithoutValue to false;
-
Splitting the QuoteType and WithoutValue setting in two different settings;