diff --git a/src/main/java/org/htmlunit/javascript/preprocessor/HtmxOneNineTenScriptPreprozessor.java b/src/main/java/org/htmlunit/javascript/preprocessor/HtmxOneNineTenScriptPreprozessor.java
index 745d7502ade..b891e4eb62b 100644
--- a/src/main/java/org/htmlunit/javascript/preprocessor/HtmxOneNineTenScriptPreprozessor.java
+++ b/src/main/java/org/htmlunit/javascript/preprocessor/HtmxOneNineTenScriptPreprozessor.java
@@ -42,20 +42,22 @@ public String preProcess(final HtmlPage htmlPage, final String sourceCode, final
String patchedSourceCode = sourceCode;
- if (sourceName.contains("/htmx.js")) {
+ if (sourceName.contains("/htmx.js") && !sourceName.contains("/htmx.js#")) {
patchedSourceCode = StringUtils.replace(
sourceCode,
"function makeTagRegEx(tag, global = false) {",
"function makeTagRegEx(tag) {\n"
- + " "
- + "var global = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;\n");
+ + " "
+ + "var global = arguments.length > 1 && arguments[1] !== undefined "
+ + "? arguments[1] : false;\n");
}
- else if (sourceName.contains("/htmx.min.js")) {
+ else if (sourceName.contains("/htmx.min.js") && !sourceName.contains("/htmx.min.js#")) {
patchedSourceCode = StringUtils.replace(
sourceCode,
"function e(e,t=false){",
"function e(e){"
- + "var t = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false; ");
+ + "var t = arguments.length > 1 && arguments[1] !== undefined "
+ + "? arguments[1] : false; ");
}
if (nextScriptPreProcessor_ != null) {