Upstream zzzprojects/html-agility-pack state of the touched files before cda2ad348b
This commit is contained in:
1 parent
56dba32abf
commit
c0a3e1d33a
2 files changed
+1
-27
No files matched your search
@@ -663,8 +663,7 @@ namespace HtmlAgilityPack
|
||||
}
|
||||
catch
|
||||
{
|
||||
// 'e' already starts with '#', so prepending "&#" would duplicate it.
|
||||
sb.Append("&" + e + ";");
|
||||
sb.Append("&#" + e + ";");
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -1,25 +0,0 @@
|
||||
using Xunit;
|
||||
|
||||
namespace HtmlAgilityPack.Tests.NetStandard2_0
|
||||
{
|
||||
public class HtmlEntityDeEntitizeTests
|
||||
{
|
||||
[Theory]
|
||||
// Invalid numeric entities must be left untouched; "&#foo;" used to become
|
||||
// "&##foo;".
|
||||
[InlineData("&#foo;", "&#foo;")]
|
||||
[InlineData("&#xGG;", "&#xGG;")]
|
||||
[InlineData("&#;", "&#;")]
|
||||
[InlineData("prefix &#foo; suffix", "prefix &#foo; suffix")]
|
||||
// Valid numeric entities keep decoding correctly.
|
||||
[InlineData("A", "A")]
|
||||
[InlineData("A", "A")]
|
||||
// Named entities are unaffected.
|
||||
[InlineData("&", "&")]
|
||||
[InlineData("¬real;", "¬real;")]
|
||||
public void DeEntitize_HandlesInvalidNumericEntitiesWithoutDuplicatingHash(string input, string expected)
|
||||
{
|
||||
Assert.Equal(expected, HtmlEntity.DeEntitize(input));
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user