From ad35846036a9e528e98e094be44339d2d9ee8e84 Mon Sep 17 00:00:00 2001 From: Gerd Aschemann Date: Mon, 16 Sep 2024 12:59:09 +0200 Subject: [PATCH] WIP 342 Handle < and > in URIs as invalid --- .../src/main/java/org/aim42/htmlsanitycheck/tools/Web.java | 2 +- .../test/groovy/org/aim42/htmlsanitycheck/tools/WebSpec.groovy | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java index b1ae241e..9450ab65 100644 --- a/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java +++ b/htmlSanityCheck-core/src/main/java/org/aim42/htmlsanitycheck/tools/Web.java @@ -190,7 +190,7 @@ public static boolean isCrossReference(String xref) { } - private static final Pattern ILLEGAL_CHARS_REGEX = Pattern.compile("[ *$]"); + private static final Pattern ILLEGAL_CHARS_REGEX = Pattern.compile("[ *$<>]"); /** * helper to identify invalid characters in link diff --git a/htmlSanityCheck-core/src/test/groovy/org/aim42/htmlsanitycheck/tools/WebSpec.groovy b/htmlSanityCheck-core/src/test/groovy/org/aim42/htmlsanitycheck/tools/WebSpec.groovy index a3a44221..0fb0c434 100644 --- a/htmlSanityCheck-core/src/test/groovy/org/aim42/htmlsanitycheck/tools/WebSpec.groovy +++ b/htmlSanityCheck-core/src/test/groovy/org/aim42/htmlsanitycheck/tools/WebSpec.groovy @@ -65,7 +65,7 @@ class WebSpec extends Specification { true | "#Context Analysis" // regression test, contains blank true | "*Context-Analysis" // * is not allowed - + true | "../concepts/workflow.html#catalog" // < etc. ist not allowed }