@kedataindo/docflow-plugins 0.0.87 → 0.0.88

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
@@ -911,8 +911,22 @@ var GoogleDocsHighlight = import_extension_highlight.default.extend({
911
911
  return [
912
912
  // Standard <mark> tag (default TipTap behavior)
913
913
  { tag: "mark" },
914
- // Google Docs pastes background-color as inline span style
915
- { tag: "span", style: "background-color" }
914
+ // Google Docs pastes background-color as an inline span style.
915
+ //
916
+ // This MUST be a *style* rule (no `tag`). A tag rule — `{ tag: 'span',
917
+ // style: 'background-color' }` — is treated as `{ tag: 'span' }` by
918
+ // ProseMirror (a rule with `tag` is a tag rule and `style` is ignored),
919
+ // and since mark rules run before node rules and only the first matching
920
+ // tag rule wins, it swallows EVERY <span>: custom nodes such as
921
+ // `span[data-toc-page]` degrade to highlight-marked text on load (issue
922
+ // #23), and it also loses to TextStyle's own bare span rule anyway.
923
+ //
924
+ // A style rule is applied in addition to the matched tag rule (see
925
+ // DOMParser.readStyles), and only fires for elements that actually carry
926
+ // the inline style — so bare spans and custom span-nodes are left alone.
927
+ // `getAttrs` receives the style VALUE here (not the element), so read the
928
+ // colour straight from it.
929
+ { style: "background-color", getAttrs: (value) => ({ color: value }) }
916
930
  ];
917
931
  },
918
932
  renderHTML({ HTMLAttributes }) {
package/dist/index.js CHANGED
@@ -818,8 +818,22 @@ var GoogleDocsHighlight = Highlight.extend({
818
818
  return [
819
819
  // Standard <mark> tag (default TipTap behavior)
820
820
  { tag: "mark" },
821
- // Google Docs pastes background-color as inline span style
822
- { tag: "span", style: "background-color" }
821
+ // Google Docs pastes background-color as an inline span style.
822
+ //
823
+ // This MUST be a *style* rule (no `tag`). A tag rule — `{ tag: 'span',
824
+ // style: 'background-color' }` — is treated as `{ tag: 'span' }` by
825
+ // ProseMirror (a rule with `tag` is a tag rule and `style` is ignored),
826
+ // and since mark rules run before node rules and only the first matching
827
+ // tag rule wins, it swallows EVERY <span>: custom nodes such as
828
+ // `span[data-toc-page]` degrade to highlight-marked text on load (issue
829
+ // #23), and it also loses to TextStyle's own bare span rule anyway.
830
+ //
831
+ // A style rule is applied in addition to the matched tag rule (see
832
+ // DOMParser.readStyles), and only fires for elements that actually carry
833
+ // the inline style — so bare spans and custom span-nodes are left alone.
834
+ // `getAttrs` receives the style VALUE here (not the element), so read the
835
+ // colour straight from it.
836
+ { style: "background-color", getAttrs: (value) => ({ color: value }) }
823
837
  ];
824
838
  },
825
839
  renderHTML({ HTMLAttributes }) {
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@kedataindo/docflow-plugins",
3
3
  "license": "Apache-2.0",
4
- "version": "0.0.87",
4
+ "version": "0.0.88",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
7
7
  "module": "./dist/index.js",