@vxrn/mdx 1.2.44 → 1.2.45
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.mjs
CHANGED
|
@@ -19979,8 +19979,10 @@ var import_unist_util_visit4 = __toESM(require_unist_util_visit()), re = /\b([-\
|
|
|
19979
19979
|
function onelement(node) {
|
|
19980
19980
|
let match;
|
|
19981
19981
|
if (node.tagName === "code" && node.data && node.data.meta)
|
|
19982
|
-
for (re.lastIndex = 0; match = re.exec(node.data.meta); )
|
|
19983
|
-
|
|
19982
|
+
for (re.lastIndex = 0; match = re.exec(node.data.meta); ) {
|
|
19983
|
+
let key2 = match[1], value = match[2] || match[3] || match[4] || "";
|
|
19984
|
+
key2 === "class" || key2 === "className" ? node.properties.className = [...node.properties.className || [], value] : node.properties[key2] = value;
|
|
19985
|
+
}
|
|
19984
19986
|
}
|
|
19985
19987
|
};
|
|
19986
19988
|
|
package/package.json
CHANGED
|
@@ -15,7 +15,15 @@ export default (options = {}) => {
|
|
|
15
15
|
re.lastIndex = 0 // Reset regex.
|
|
16
16
|
|
|
17
17
|
while ((match = re.exec(node.data.meta))) {
|
|
18
|
-
|
|
18
|
+
const key = match[1]
|
|
19
|
+
const value = match[2] || match[3] || match[4] || ''
|
|
20
|
+
|
|
21
|
+
// Merge class/className into existing className array to avoid duplicate key warning
|
|
22
|
+
if (key === 'class' || key === 'className') {
|
|
23
|
+
node.properties.className = [...(node.properties.className || []), value]
|
|
24
|
+
} else {
|
|
25
|
+
node.properties[key] = value
|
|
26
|
+
}
|
|
19
27
|
}
|
|
20
28
|
}
|
|
21
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"rehypeMetaAttribute.d.ts","sourceRoot":"","sources":["../src/rehypeMetaAttribute.tsx"],"names":[],"mappings":"yBAMgB,YAAY,MAClB,SAAI;AADd,
|
|
1
|
+
{"version":3,"file":"rehypeMetaAttribute.d.ts","sourceRoot":"","sources":["../src/rehypeMetaAttribute.tsx"],"names":[],"mappings":"yBAMgB,YAAY,MAClB,SAAI;AADd,wBAuBC"}
|