diff --git a/OWASP.AntiSamyTests/Html/AntiSamyTest.cs b/OWASP.AntiSamyTests/Html/AntiSamyTest.cs index c63b57c..3788ad5 100644 --- a/OWASP.AntiSamyTests/Html/AntiSamyTest.cs +++ b/OWASP.AntiSamyTests/Html/AntiSamyTest.cs @@ -982,5 +982,13 @@ public void TestRegexStackOverflow() } result.Should().NotBeNull(); } + + [Test] + public void TestBangCommentWhenPreservingComments() + { + Policy revised = policy.CloneWithDirective(Constants.PRESERVE_COMMENTS, "true"); + antisamy.Scan("
  • -->

    ", revised).GetCleanHtml().Should().NotContain("mxss"); + antisamy.Scan("
  • -->

    ", revised).GetCleanHtml().Should().NotContain("mxss"); + } } }