Skip to content

Commit 3053029

Browse files
Add meta
1 parent 07f2c45 commit 3053029

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

packages/mdx/src/plugins/rehype/rehypeSyntaxHighlighting.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -138,6 +138,11 @@ export const rehypeSyntaxHighlighting: Plugin<[RehypeSyntaxHighlightingOptions?]
138138
}
139139
});
140140

141+
if (node.data?.meta) {
142+
node.data.meta = node.data.meta.replace(lineHighlightPattern, '').trim();
143+
}
144+
codeElement.data = node.data;
145+
if (codeElement.children[0]) codeElement.children[0].data = node.data;
141146
parent.children.splice(index, 1, codeElement);
142147
} catch (err) {
143148
if (options.ignoreMissing && /Unknown language/.test((err as Error).message)) {

0 commit comments

Comments
 (0)