mirror of
https://github.com/sern-handler/website
synced 2026-06-27 18:22:22 +00:00
15 lines
359 B
JavaScript
15 lines
359 B
JavaScript
import { visit } from "unist-util-visit";
|
|
function rehypeMetaString() {
|
|
return function(tree) {
|
|
visit(tree, (node) => {
|
|
if (node.type === "element" && node.tagName === "code" && node.data?.meta) {
|
|
node.properties ??= {};
|
|
node.properties.metastring = node.data.meta;
|
|
}
|
|
});
|
|
};
|
|
}
|
|
export {
|
|
rehypeMetaString as default
|
|
};
|