Skip to content

Commit

Permalink
Update HtmlNode.cs
Browse files Browse the repository at this point in the history
  • Loading branch information
JonathanMagnan committed Jan 23, 2020
1 parent 5f82294 commit 1aa7334
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/HtmlAgilityPack.Shared/HtmlNode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2146,8 +2146,10 @@ internal void WriteAttribute(TextWriter outText, HtmlAttribute att)
return;
}
}



var value = att.QuoteType == AttributeValueQuote.DoubleQuote ? att.Value.Replace("\"", """) : att.Value.Replace("'", "'");
var value = att.QuoteType == AttributeValueQuote.DoubleQuote ? !att.Value.StartsWith("@") ? att.Value.Replace("\"", """) : att.Value : att.Value.Replace("'", "'");
if (_ownerdocument.OptionOutputOptimizeAttributeValues)
if (att.Value.IndexOfAny(new char[] {(char) 10, (char) 13, (char) 9, ' '}) < 0)
outText.Write(" " + name + "=" + att.Value);
Expand Down

0 comments on commit 1aa7334

Please sign in to comment.