rehype-meta-string.ts — astro Source File
Architecture documentation for rehype-meta-string.ts, a typescript file in the astro codebase. 1 imports, 0 dependents.
Entity Profile
Dependency Diagram
graph LR e1b8149b_6548_005c_4e5a_a60fe15b7cab["rehype-meta-string.ts"] d7b51bf7_4a46_1479_0cea_09e174fc7c48["unist-util-visit"] e1b8149b_6548_005c_4e5a_a60fe15b7cab --> d7b51bf7_4a46_1479_0cea_09e174fc7c48 style e1b8149b_6548_005c_4e5a_a60fe15b7cab fill:#6366f1,stroke:#818cf8,color:#fff
Relationship Graph
Source Code
import { visit } from 'unist-util-visit';
/**
* Moves `data.meta` to `properties.metastring` for the `code` element node
* as `rehype-raw` strips `data` from all nodes, which may contain useful information.
* e.g. ```js {1:3} => metastring: "{1:3}"
*/
export default function rehypeMetaString() {
return function (tree: any) {
visit(tree, (node) => {
if (node.type === 'element' && node.tagName === 'code' && node.data?.meta) {
node.properties ??= {};
node.properties.metastring = node.data.meta;
}
});
};
}
Domain
Subdomains
Functions
Dependencies
- unist-util-visit
Source
Frequently Asked Questions
What does rehype-meta-string.ts do?
rehype-meta-string.ts is a source file in the astro codebase, written in typescript. It belongs to the CoreAstro domain, RoutingSystem subdomain.
What functions are defined in rehype-meta-string.ts?
rehype-meta-string.ts defines 1 function(s): rehypeMetaString.
What does rehype-meta-string.ts depend on?
rehype-meta-string.ts imports 1 module(s): unist-util-visit.
Where is rehype-meta-string.ts in the architecture?
rehype-meta-string.ts is located at packages/integrations/mdx/src/rehype-meta-string.ts (domain: CoreAstro, subdomain: RoutingSystem, directory: packages/integrations/mdx/src).
Analyze Your Own Codebase
Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.
Try Supermodel Free