@tixyel/streamelements 4.5.5 → 4.5.6

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.es.js CHANGED
@@ -5321,11 +5321,11 @@ const Z = {
5321
5321
  mergeSpanStyles(s, e, a) {
5322
5322
  const n = e.match(/^<span(?: class="[^"]*")? style="([^"]*)">(.*)<\/span>$/s);
5323
5323
  if (n) {
5324
- const t = n[1], r = n[2], c = n[0].match(/class="([^"]*)"/)?.[1] || "";
5325
- var i = [t, s].filter((d) => d.length).map((d) => d.endsWith(";") ? d.slice(0, -1) : d).join("; ").replace(/\s*;\s*/g, "; ").trim();
5326
- return i.endsWith(";") || (i += ";"), `<span${c ? ` class="${c} ${a ?? ""}"` : ""}${i ? ` style="${i}"` : ""}>${r}</span>`;
5324
+ const i = n[1], t = n[2], r = n[0].match(/class="([^"]*)"/)?.[1] || "";
5325
+ let c = [i, s].filter((d) => d.length).map((d) => d.endsWith(";") ? d.slice(0, -1) : d).join("; ").replace(/\s*;\s*/g, "; ").trim();
5326
+ return c.endsWith(";") || (c += ";"), `<span${r ? ` class="${r} ${a ?? ""}"` : ""}${c ? ` style="${c}"` : ""}>${t}</span>`;
5327
5327
  } else
5328
- return `<span${a ? ` class="${a}"` : ""}${s ? ` style="${s}"` : ""}>${e}</span>`;
5328
+ return s && s.length && !s.endsWith(";") && (s += ";"), `<span${a ? ` class="${a}"` : ""}${s ? ` style="${s}"` : ""}>${e}</span>`;
5329
5329
  },
5330
5330
  /**
5331
5331
  * Scales an HTML element to fit within its parent element based on specified minimum and maximum scale factors.