@readme/markdown 13.7.1 → 13.7.2

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.
@@ -75,10 +75,20 @@ const TailwindStyle = ({ children, darkModeDataAttribute }: Props) => {
75
75
  records.forEach(record => {
76
76
  if (record.type === 'childList') {
77
77
  record.addedNodes.forEach(node => {
78
- if (!(node instanceof HTMLElement) || !node.classList.contains(tailwindPrefix)) return;
79
-
80
- traverse(node, addClasses);
81
- shouldUpdate = true;
78
+ if (!(node instanceof HTMLElement)) return;
79
+
80
+ // Check the added node itself
81
+ if (node.classList.contains(tailwindPrefix)) {
82
+ traverse(node, addClasses);
83
+ shouldUpdate = true;
84
+ }
85
+
86
+ // Also check descendants — React may insert a parent node
87
+ // whose children contain TailwindRoot elements
88
+ node.querySelectorAll(`.${tailwindPrefix}`).forEach(child => {
89
+ traverse(child, addClasses);
90
+ shouldUpdate = true;
91
+ });
82
92
  });
83
93
  } else if (record.type === 'attributes') {
84
94
  if (record.attributeName !== 'class' || !(record.target instanceof HTMLElement)) return;
@@ -29,7 +29,7 @@ export declare function mdxishAstProcessor(mdContent: string, opts?: MdxishOpts)
29
29
  parserReadyContent: string;
30
30
  };
31
31
  /**
32
- * Converts an Mdast to a Markdown string.
32
+ * Serializes an Mdast back into a markdown string.
33
33
  */
34
34
  export declare function mdxishMdastToMd(mdast: MdastRoot): string;
35
35
  /**