fix: skip invalid code block metadata without key-value pairs (#561)

This ensures compatibility with transformers like `transformerMetaHighlight`, which may include metadata without key-value formatting.

Previously, metadata entries without an = would cause [key, value] to be undefined, potentially introducing invalid entries into the map. We now skip such entries to ensure only valid key-value pairs are parsed.
This commit is contained in:
Sebastian Arrieta
2025-07-19 12:13:44 -05:00
committed by GitHub
parent 9d96bbd57f
commit c5a34c7838
+1
View File
@@ -29,6 +29,7 @@ export const transformerFileName = ({
for (const item of raw) {
const [key, value] = item.split("=");
if (!key || !value) continue;
metaMap.set(key, value.replace(/["'`]/g, ""));
}