We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 12efbe3 commit fdc577dCopy full SHA for fdc577d
1 file changed
index.ts
@@ -44,6 +44,11 @@ declare const htmx: typeof htmxType;
44
response = full;
45
}
46
47
+ // Skip comment-only chunks (heartbeats), but allow empty chunks through
48
+ const hasComment = /<!--[\s\S]*?-->/.test(response);
49
+ const stripped = response.replace(/<!--[\s\S]*?-->/g, "").trim();
50
+ if (hasComment && stripped.length === 0) return;
51
+
52
api.withExtensions(elt, function (extension) {
53
if (!extension.transformResponse) return;
54
response = extension.transformResponse(response, xhr, elt);
0 commit comments