embed-transform.ts#
4 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.
Reference#
moduleembed-transformReserve first-party embed components so MDX island lowering cannot swallow them. Rust still emits data-ox-island for ev…
Reserve first-party embed components so MDX island lowering cannot swallow them.
Rust still emits data-ox-island for every PascalCase tag. This rewrite turns reserved built-in names back into HTML tags so transformBuiltinEmbeds can run. A document-local import of the same name keeps the island.
variableconst PAYLOAD_SCRIPT = /^\s*<script type="application\/json">[\s\S]*?<\/script>/Reserve first-party embed components so MDX island lowering cannot swallow them…
Reserve first-party embed components so MDX island lowering cannot swallow them.
Rust still emits data-ox-island for every PascalCase tag. This rewrite turns reserved built-in names back into HTML tags so transformBuiltinEmbeds can run. A document-local import of the same name keeps the island.
Signature
const PAYLOAD_SCRIPT = /^\s*<script type="application\/json">[\s\S]*?<\/script>/variableconst RESERVED_BUILTIN_COMPONENTS = [ "GitHub", "OgCard", "Tweet", "XPost", "Reddit", "Bluesky", "GoogleMaps", "Qiita", "Zenn", "NpmPackage", "CratesIo", "PyPI", "DockerHub", "CodePen", "JSFiddle", "Observable", "Vimeo", "Twitch", "Discord", "Fediverse", "Mastodon", "Misskey", "Mixi2", "Facebook", "Threads", "Instagram", "Spotify", "AppleMusic", "SpeakerDeck", "Audio", "Video", "StackBlitz", "WebContainer", "YouTube", "NotByAI", ] as constCanonical PascalCase names for first-party embed / media components. Keep in sy…
Canonical PascalCase names for first-party embed / media components. Keep in sync with SELF_CLOSING_EMBED_TAG in ./index.ts.
Signature
export const RESERVED_BUILTIN_COMPONENTS = [
"GitHub",
"OgCard",
"Tweet",
"XPost",
"Reddit",
"Bluesky",
"GoogleMaps",
"Qiita",
"Zenn",
"NpmPackage",
"CratesIo",
"PyPI",
"DockerHub",
"CodePen",
"JSFiddle",
"Observable",
"Vimeo",
"Twitch",
"Discord",
"Fediverse",
"Mastodon",
"Misskey",
"Mixi2",
"Facebook",
"Threads",
"Instagram",
"Spotify",
"AppleMusic",
"SpeakerDeck",
"Audio",
"Video",
"StackBlitz",
"WebContainer",
"YouTube",
"NotByAI",
] as constfnrestoreReservedBuiltinIslands(html: string, localNames?: Iterable<string>): stringReplace reserved built-in islands with the original HTML tags so embed transfor…
Replace reserved built-in islands with the original HTML tags so embed transforms can see them. Document-local bindings of the same name stay islands.
Signature
export function restoreReservedBuiltinIslands(html: string, localNames?: Iterable<string>): stringParameters
-
htmlstring -
localNamesIterable<string>optional
Returns
string