# embed-transform.ts

**[Source](https://github.com/ubugeeei-prod/ox-content/blob/main/npm/vite-plugin-ox-content/src/plugins/embed-transform.ts)**

> 4 documented symbols. Read the signatures first, then expand each item for parameters, return types, and examples.

<div class="ox-api-stats" aria-label="API reference summary">
<span class="ox-api-stat">
  <strong>4</strong>
  <span>symbols</span>
</span>
<span class="ox-api-stat">
  <strong>1</strong>
  <span>functions</span>
</span>
<span class="ox-api-stat">
  <strong>2</strong>
  <span>variables</span>
</span>
<span class="ox-api-stat">
  <strong>1</strong>
  <span>modules</span>
</span>
<span class="ox-api-stat">
  <strong>2</strong>
  <span>parameters</span>
</span>
<span class="ox-api-stat">
  <strong>1</strong>
  <span>returns</span>
</span>
</div>

## Reference

<div class="ox-api-controls" data-ox-api-target=".ox-api-entry" role="toolbar" aria-label="Reference display controls">
<button type="button" class="ox-api-controls__button" data-ox-api-toggle="expand">Open all</button>
<button type="button" class="ox-api-controls__button" data-ox-api-toggle="collapse">Close all</button>
</div>

<details id="embed-transform" class="ox-api-entry">
  <summary><span class="ox-api-entry__kind">module</span><span class="ox-api-entry__summary-main"><code class="ox-api-entry__name">embed-transform</code><span class="ox-api-entry__description">Reserve first-party embed components so MDX island lowering cannot swallow them. Rust still emits data-ox-island for ev…</span></span></summary>
  <div class="ox-api-entry__body">
<div class="ox-api-entry__prose">
<p>Reserve first-party embed components so MDX island lowering cannot swallow them.</p>
<p>Rust still emits <code>data-ox-island</code> for every PascalCase tag. This rewrite turns reserved built-in names back into HTML tags so <code>transformBuiltinEmbeds</code> can run. A document-local import of the same name keeps the island.</p>
</div>
<p class="ox-api-entry__source"><a class="ox-api-entry__source-link" href="https://github.com/ubugeeei-prod/ox-content/blob/main/npm/vite-plugin-ox-content/src/plugins/embed-transform.ts#L1-L7" target="_blank" rel="noopener noreferrer">View source<span class="ox-api-entry__source-icon" aria-hidden="true"></span></a></p>
  </div>
</details>

<details id="payload_script" class="ox-api-entry">
  <summary><span class="ox-api-entry__kind">variable</span><span class="ox-api-entry__summary-main"><code class="ox-api-entry__signature ox-api-entry__signature--highlighted language-typescript">const PAYLOAD_SCRIPT = /^\s*&lt;script type=&quot;application\/json&quot;&gt;[\s\S]*?&lt;\/script&gt;/</code><span class="ox-api-entry__description">Reserve first-party embed components so MDX island lowering cannot swallow them…</span></span></summary>
  <div class="ox-api-entry__body">
<div class="ox-api-entry__prose">
<p>Reserve first-party embed components so MDX island lowering cannot swallow them.</p>
<p>Rust still emits <code>data-ox-island</code> for every PascalCase tag. This rewrite turns reserved built-in names back into HTML tags so <code>transformBuiltinEmbeds</code> can run. A document-local import of the same name keeps the island.</p>
</div>
<div class="ox-api-entry__section ox-api-entry__section--signature">
<h4>Signature</h4>
<pre><code class="language-typescript">const PAYLOAD_SCRIPT = /^\s*&lt;script type=&quot;application\/json&quot;&gt;[\s\S]*?&lt;\/script&gt;/</code></pre>
</div>
<p class="ox-api-entry__source"><a class="ox-api-entry__source-link" href="https://github.com/ubugeeei-prod/ox-content/blob/main/npm/vite-plugin-ox-content/src/plugins/embed-transform.ts#L9" target="_blank" rel="noopener noreferrer">View source<span class="ox-api-entry__source-icon" aria-hidden="true"></span></a></p>
  </div>
</details>

<details id="reserved_builtin_components" class="ox-api-entry">
  <summary><span class="ox-api-entry__kind">variable</span><span class="ox-api-entry__summary-main"><code class="ox-api-entry__signature ox-api-entry__signature--highlighted language-typescript">const RESERVED_BUILTIN_COMPONENTS = [ &quot;GitHub&quot;, &quot;OgCard&quot;, &quot;Tweet&quot;, &quot;XPost&quot;, &quot;Reddit&quot;, &quot;Bluesky&quot;, &quot;GoogleMaps&quot;, &quot;Qiita&quot;, &quot;Zenn&quot;, &quot;NpmPackage&quot;, &quot;CratesIo&quot;, &quot;PyPI&quot;, &quot;DockerHub&quot;, &quot;CodePen&quot;, &quot;JSFiddle&quot;, &quot;Observable&quot;, &quot;Vimeo&quot;, &quot;Twitch&quot;, &quot;Discord&quot;, &quot;Fediverse&quot;, &quot;Mastodon&quot;, &quot;Misskey&quot;, &quot;Mixi2&quot;, &quot;Facebook&quot;, &quot;Threads&quot;, &quot;Instagram&quot;, &quot;Spotify&quot;, &quot;AppleMusic&quot;, &quot;SpeakerDeck&quot;, &quot;Audio&quot;, &quot;Video&quot;, &quot;StackBlitz&quot;, &quot;WebContainer&quot;, &quot;YouTube&quot;, &quot;NotByAI&quot;, ] as const</code><span class="ox-api-entry__description">Canonical PascalCase names for first-party embed / media components. Keep in sy…</span></span></summary>
  <div class="ox-api-entry__body">
<div class="ox-api-entry__prose">
<p>Canonical PascalCase names for first-party embed / media components. Keep in sync with <code>SELF_CLOSING_EMBED_TAG</code> in <code>./index.ts</code>.</p>
</div>
<div class="ox-api-entry__section ox-api-entry__section--signature">
<h4>Signature</h4>
<pre><code class="language-typescript">export const RESERVED_BUILTIN_COMPONENTS = [
  &quot;GitHub&quot;,
  &quot;OgCard&quot;,
  &quot;Tweet&quot;,
  &quot;XPost&quot;,
  &quot;Reddit&quot;,
  &quot;Bluesky&quot;,
  &quot;GoogleMaps&quot;,
  &quot;Qiita&quot;,
  &quot;Zenn&quot;,
  &quot;NpmPackage&quot;,
  &quot;CratesIo&quot;,
  &quot;PyPI&quot;,
  &quot;DockerHub&quot;,
  &quot;CodePen&quot;,
  &quot;JSFiddle&quot;,
  &quot;Observable&quot;,
  &quot;Vimeo&quot;,
  &quot;Twitch&quot;,
  &quot;Discord&quot;,
  &quot;Fediverse&quot;,
  &quot;Mastodon&quot;,
  &quot;Misskey&quot;,
  &quot;Mixi2&quot;,
  &quot;Facebook&quot;,
  &quot;Threads&quot;,
  &quot;Instagram&quot;,
  &quot;Spotify&quot;,
  &quot;AppleMusic&quot;,
  &quot;SpeakerDeck&quot;,
  &quot;Audio&quot;,
  &quot;Video&quot;,
  &quot;StackBlitz&quot;,
  &quot;WebContainer&quot;,
  &quot;YouTube&quot;,
  &quot;NotByAI&quot;,
] as const</code></pre>
</div>
<p class="ox-api-entry__source"><a class="ox-api-entry__source-link" href="https://github.com/ubugeeei-prod/ox-content/blob/main/npm/vite-plugin-ox-content/src/plugins/embed-transform.ts#L16-L52" target="_blank" rel="noopener noreferrer">View source<span class="ox-api-entry__source-icon" aria-hidden="true"></span></a></p>
  </div>
</details>

<details id="restorereservedbuiltinislands" class="ox-api-entry">
  <summary><span class="ox-api-entry__kind">fn</span><span class="ox-api-entry__summary-main"><code class="ox-api-entry__signature ox-api-entry__signature--highlighted language-typescript">restoreReservedBuiltinIslands(html: string, localNames?: Iterable&lt;string&gt;): string</code><span class="ox-api-entry__description">Replace reserved built-in islands with the original HTML tags so embed transfor…</span><span class="ox-api-entry__meta"><span class="ox-api-badge">2 params</span><span class="ox-api-badge">returns string</span></span></span></summary>
  <div class="ox-api-entry__body">
<div class="ox-api-entry__prose">
<p>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.</p>
</div>
<div class="ox-api-entry__section ox-api-entry__section--signature">
<h4>Signature</h4>
<pre><code class="language-typescript">export function restoreReservedBuiltinIslands(html: string, localNames?: Iterable&lt;string&gt;): string</code></pre>
</div>
<p class="ox-api-entry__source"><a class="ox-api-entry__source-link" href="https://github.com/ubugeeei-prod/ox-content/blob/main/npm/vite-plugin-ox-content/src/plugins/embed-transform.ts#L80-L105" target="_blank" rel="noopener noreferrer">View source<span class="ox-api-entry__source-icon" aria-hidden="true"></span></a></p>
<div class="ox-api-entry__section ox-api-entry__section--params">
<h4>Parameters</h4>
<ul class="ox-api-entry__params">
<li class="ox-api-entry__param">
  <div class="ox-api-entry__param-heading">
    <code class="ox-api-entry__param-name">html</code>
    <code class="ox-api-entry__param-type">string</code>
  </div>
</li>
<li class="ox-api-entry__param">
  <div class="ox-api-entry__param-heading">
    <code class="ox-api-entry__param-name">localNames</code>
    <code class="ox-api-entry__param-type">Iterable&lt;string&gt;</code>
  </div>
  <p class="ox-api-entry__param-description">optional</p>
</li>
</ul>
</div>
<div class="ox-api-entry__section ox-api-entry__section--returns">
<h4>Returns</h4>
<div class="ox-api-entry__return">
  <code class="ox-api-entry__return-type">string</code>
</div>
</div>
  </div>
</details>
