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 f8209d58..240524ed 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
@@ -158,6 +158,9 @@ public static boolean isRemoteURL(String imgSrc) {
|| startsWithIP(imgSrc);
}
+ public static boolean isVirtualURL(String resource) {
+ return resource.startsWith("javascript:");
+ }
/**
* Checks if this String represents a data-image-URI
@@ -211,6 +214,7 @@ public static boolean isLocalResource(String link) {
|| (link.isEmpty())
|| isCrossReference(link) // "#link" or similar
|| isRemoteURL(link) // "mailto:", "http" etc
+ || isVirtualURL(link) // "javascript:" ...
) {
return false;
} else {
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 37d06be4..1ea9866e 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
@@ -107,6 +107,7 @@ class WebSpec extends Specification {
false | "10.0.0.1/index.html" // this is a valid REMOTE address, defaults to http or https
+ false | "javascript:dummy"
}
@Unroll
@@ -142,7 +143,5 @@ class WebSpec extends Specification {
false | "1.2.3"
false | "1.2"
false | "110"
-
-
}
}
\ No newline at end of file