EventArg Tag attribute unit tests
This commit is contained in:
@@ -2065,6 +2065,15 @@ rl(javascript:alert(""foo""))'>";
|
||||
Assert.That(sanitizer.Sanitize(html), Is.EqualTo(@"<div alt=""alt"" onclick=""test""></div>").IgnoreCase);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RemovingAttributeEventTagTest()
|
||||
{
|
||||
var sanitizer = new HtmlSanitizer();
|
||||
sanitizer.RemovingAttribute += (s, e) => Assert.That(e.Tag, Is.InstanceOf<IHtmlDivElement>());
|
||||
var html = @"<div alt=""alt"" onclick=""test"" onload=""test""></div>";
|
||||
sanitizer.Sanitize(html);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RemovingStyleEventTest()
|
||||
{
|
||||
@@ -2074,6 +2083,15 @@ rl(javascript:alert(""foo""))'>";
|
||||
Assert.That(sanitizer.Sanitize(html), Is.EqualTo(@"<div style=""background: 0; test: xyz""></div>").IgnoreCase);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void RemovingStyleEventTagTest()
|
||||
{
|
||||
var sanitizer = new HtmlSanitizer();
|
||||
sanitizer.RemovingStyle += (s, e) => Assert.That(e.Tag, Is.InstanceOf<IHtmlDivElement>());
|
||||
var html = @"<div style=""background: 0; test: xyz; bad: bad;""></div>";
|
||||
sanitizer.Sanitize(html);
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void ProtocolRelativeTest()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user