Home / Function/ rehypeSvgPlugin() — astro Function Reference

rehypeSvgPlugin() — astro Function Reference

Architecture documentation for the rehypeSvgPlugin() function in mdx-plugins.test.js from the astro codebase.

Entity Profile

Dependency Diagram

graph TD
  964f048f_e442_b393_ec9c_b2555854a257["rehypeSvgPlugin()"]
  e8760276_ae78_8548_876c_cdc1c14c40af["mdx-plugins.test.js"]
  964f048f_e442_b393_ec9c_b2555854a257 -->|defined in| e8760276_ae78_8548_876c_cdc1c14c40af
  style 964f048f_e442_b393_ec9c_b2555854a257 fill:#6366f1,stroke:#818cf8,color:#fff

Relationship Graph

Source Code

packages/integrations/mdx/test/mdx-plugins.test.js lines 253–268

function rehypeSvgPlugin() {
	return (tree) => {
		tree.children.push({
			type: 'element',
			tagName: 'svg',
			properties: { xmlns: 'http://www.w3.org/2000/svg' },
			children: [
				{
					type: 'element',
					tagName: 'use',
					properties: { xLinkHref: '#icon' },
				},
			],
		});
	};
}

Domain

Subdomains

Frequently Asked Questions

What does rehypeSvgPlugin() do?
rehypeSvgPlugin() is a function in the astro codebase, defined in packages/integrations/mdx/test/mdx-plugins.test.js.
Where is rehypeSvgPlugin() defined?
rehypeSvgPlugin() is defined in packages/integrations/mdx/test/mdx-plugins.test.js at line 253.

Analyze Your Own Codebase

Get architecture documentation, dependency graphs, and domain analysis for your codebase in minutes.

Try Supermodel Free