@readme/markdown 13.7.3 → 13.7.4
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/components/Glossary/index.tsx +3 -0
- package/components/TailwindStyle/index.tsx +4 -14
- package/dist/lib/mdast-util/gemoji/index.d.ts +2 -0
- package/dist/lib/micromark/gemoji/index.d.ts +4 -0
- package/dist/lib/micromark/gemoji/syntax.d.ts +9 -0
- package/dist/main.js +658 -207
- package/dist/main.node.js +658 -207
- package/dist/main.node.js.map +1 -1
- package/dist/processor/transform/extract-text.d.ts +1 -1
- package/dist/processor/transform/mdxish/close-self-closing-html-tags.d.ts +23 -0
- package/dist/processor/transform/mdxish/magic-blocks/types.d.ts +0 -12
- package/dist/processor/transform/mdxish/mdxish-jsx-to-mdast.d.ts +5 -3
- package/dist/processor/transform/mdxish/types.d.ts +15 -0
- package/package.json +2 -2
|
@@ -12,6 +12,9 @@ interface Props extends React.PropsWithChildren {
|
|
|
12
12
|
|
|
13
13
|
const Glossary = ({ children, term: termProp, terms }: Props) => {
|
|
14
14
|
const term = (Array.isArray(children) ? children[0] : children) || termProp;
|
|
15
|
+
|
|
16
|
+
if (!term) return null;
|
|
17
|
+
|
|
15
18
|
const foundTerm = terms.find(i => term.toLowerCase() === i?.term?.toLowerCase());
|
|
16
19
|
|
|
17
20
|
if (!foundTerm) return <span>{term}</span>;
|
|
@@ -75,20 +75,10 @@ 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)) return;
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
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
|
-
});
|
|
78
|
+
if (!(node instanceof HTMLElement) || !node.classList.contains(tailwindPrefix)) return;
|
|
79
|
+
|
|
80
|
+
traverse(node, addClasses);
|
|
81
|
+
shouldUpdate = true;
|
|
92
82
|
});
|
|
93
83
|
} else if (record.type === 'attributes') {
|
|
94
84
|
if (record.attributeName !== 'class' || !(record.target instanceof HTMLElement)) return;
|