thunderous 2.4.2 → 2.4.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -299,8 +299,9 @@ var wrapTemplate = ({ tagName, serverRender, options }) => {
299
299
  return finalScopedRenderString;
300
300
  };
301
301
  var insertTemplates = (tagName, template, inputString) => {
302
- return inputString.replace(new RegExp(`(<s*${tagName}([^>]*)>)`, "gm"), ($1, _, $3) => {
303
- const attrs = $3.split(/(?<=")\s+/).filter((attr) => attr.trim() !== "").map((attr) => {
302
+ const tagRegex = new RegExp(`<\\s*${tagName}((?:\\s+[^>]*)*)\\s*>`, "gm");
303
+ return inputString.replace(tagRegex, ($match, $1) => {
304
+ const attrs = $1.split(/(?<=")\s+/).filter((attr) => attr.trim() !== "").map((attr) => {
304
305
  const [_key, _value] = attr.split("=");
305
306
  const key = _key.trim();
306
307
  const value = _value?.replace(/"/g, "") ?? "";
@@ -310,7 +311,7 @@ var insertTemplates = (tagName, template, inputString) => {
310
311
  for (const [key, value] of attrs) {
311
312
  scopedResult = scopedResult.replace(new RegExp(`{{attr:${key}}}`, "gm"), value);
312
313
  }
313
- return $1 + scopedResult;
314
+ return $match + scopedResult;
314
315
  });
315
316
  };
316
317
  var clientOnlyCallback = (fn) => {
package/dist/index.js CHANGED
@@ -264,8 +264,9 @@ var wrapTemplate = ({ tagName, serverRender, options }) => {
264
264
  return finalScopedRenderString;
265
265
  };
266
266
  var insertTemplates = (tagName, template, inputString) => {
267
- return inputString.replace(new RegExp(`(<s*${tagName}([^>]*)>)`, "gm"), ($1, _, $3) => {
268
- const attrs = $3.split(/(?<=")\s+/).filter((attr) => attr.trim() !== "").map((attr) => {
267
+ const tagRegex = new RegExp(`<\\s*${tagName}((?:\\s+[^>]*)*)\\s*>`, "gm");
268
+ return inputString.replace(tagRegex, ($match, $1) => {
269
+ const attrs = $1.split(/(?<=")\s+/).filter((attr) => attr.trim() !== "").map((attr) => {
269
270
  const [_key, _value] = attr.split("=");
270
271
  const key = _key.trim();
271
272
  const value = _value?.replace(/"/g, "") ?? "";
@@ -275,7 +276,7 @@ var insertTemplates = (tagName, template, inputString) => {
275
276
  for (const [key, value] of attrs) {
276
277
  scopedResult = scopedResult.replace(new RegExp(`{{attr:${key}}}`, "gm"), value);
277
278
  }
278
- return $1 + scopedResult;
279
+ return $match + scopedResult;
279
280
  });
280
281
  };
281
282
  var clientOnlyCallback = (fn) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "thunderous",
3
- "version": "2.4.2",
3
+ "version": "2.4.3",
4
4
  "description": "A lightweight, functional web components library that brings the power of signals to your UI.",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",