From f56025b6cb963b23052705c1f6362632d8dbd12c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebasti=C3=A1n=20Passaro?= Date: Sat, 28 Aug 2021 14:24:05 -0300 Subject: [PATCH] Add test for negative exponential --- src/test/java/org/owasp/validator/html/test/AntiSamyTest.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/test/java/org/owasp/validator/html/test/AntiSamyTest.java b/src/test/java/org/owasp/validator/html/test/AntiSamyTest.java index 2f757764..689402b0 100644 --- a/src/test/java/org/owasp/validator/html/test/AntiSamyTest.java +++ b/src/test/java/org/owasp/validator/html/test/AntiSamyTest.java @@ -1513,12 +1513,14 @@ public void testGithubIssue99() throws ScanException, PolicyException { @Test public void testGithubIssue101() throws ScanException, PolicyException { // Test that margin attribute is not removed when value has too much significant figures. - // Current behavior is that decimals like 0.0001 are internally translated to 1.0-E4, this + // Current behavior is that decimals like 0.0001 are internally translated to 1.0E-4, this // is reflected on regex validation and actual output. The inconsistency is due to Batik CSS. assertThat(as.scan("

Some text.

", policy, AntiSamy.DOM).getCleanHTML(), containsString("margin")); assertThat(as.scan("

Some text.

", policy, AntiSamy.SAX).getCleanHTML(), containsString("margin")); assertThat(as.scan("

Some text.

", policy, AntiSamy.DOM).getCleanHTML(), containsString("margin")); assertThat(as.scan("

Some text.

", policy, AntiSamy.SAX).getCleanHTML(), containsString("margin")); + assertThat(as.scan("

Some text.

", policy, AntiSamy.DOM).getCleanHTML(), containsString("margin")); + assertThat(as.scan("

Some text.

", policy, AntiSamy.SAX).getCleanHTML(), containsString("margin")); // When using exponential directly the "e" or "E" is internally considered as the start of // the dimension/unit type. This creates inconsistencies that make the regex validation fail, // also in cases like 1e4pt where "e" is considered as dimension instead of "pt".