svelte-rtf-editor 1.0.2 → 1.0.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.
@@ -148,15 +148,13 @@ function parseColorTable(group) {
148
148
  b = node.param ?? 0;
149
149
  }
150
150
  else if (node.type === 'text' && node.value.includes(';')) {
151
- // Semicolons delimit color entries; there may be multiple in one text node
152
- const parts = node.value.split(';');
153
- for (let i = 0; i < parts.length; i++) {
154
- if (i < parts.length - 1 || node.value.endsWith(';')) {
155
- colors.push(`rgb(${r},${g},${b})`);
156
- r = 0;
157
- g = 0;
158
- b = 0;
159
- }
151
+ // Each ';' terminates one color entry
152
+ const semiCount = (node.value.match(/;/g) || []).length;
153
+ for (let i = 0; i < semiCount; i++) {
154
+ colors.push(`rgb(${r},${g},${b})`);
155
+ r = 0;
156
+ g = 0;
157
+ b = 0;
160
158
  }
161
159
  }
162
160
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-rtf-editor",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "RTF viewer and rich-text editor components for Svelte 5",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/jcelano/svelte-rtf-editor#readme",