svelte-rtf-editor 1.5.0 → 1.5.1

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.
@@ -444,8 +444,9 @@ export function rtfToHtml(rtfString) {
444
444
  }
445
445
  }
446
446
  }
447
- // Sizes are shown relative to the body: body text carries no size of its
448
- // own, and headings are recognized by their ratio to it.
447
+ // Headings are recognized by their ratio to the body size. Text keeps its
448
+ // own size, though: anything other than 12 pt carries a font-size, so a
449
+ // document written at 9 pt still shows at 9 pt.
449
450
  const bodySize = bodyHalfPoints(rootGroup);
450
451
  // State stack for nested groups
451
452
  function defaultState() {
@@ -484,7 +485,7 @@ export function rtfToHtml(rtfString) {
484
485
  if (bg)
485
486
  styles.push(`background-color:${bg}`);
486
487
  }
487
- if (state.fontSize && state.fontSize !== bodySize) {
488
+ if (state.fontSize && state.fontSize !== DEFAULT_HALF_POINTS) {
488
489
  styles.push(`font-size:${state.fontSize / 2}pt`);
489
490
  }
490
491
  if (styles.length === 0)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "svelte-rtf-editor",
3
- "version": "1.5.0",
3
+ "version": "1.5.1",
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",