Workers AI - Plain text output for Markdown Conversion
- Announced
- Tags
- Workers-AI
- Severity
- info, set by
reef/rss-rule-v1 - Source
- https://developers.cloudflare.com/changelog/post/2026-07-13-markdown-conversion-text-output/
<p>The <a href="https://developers.cloudflare.com/workers-ai/features/markdown-conversion/">Markdown Conversion</a> service now supports a new <code>output</code> conversion option that controls the format of the converted content.</p> <p>Set <code>output.format</code> to <code>text</code> to receive plain text with Markdown syntax removed. The default value is <code>markdown</code>, so existing conversions are unchanged.</p> <p>Use the <a href="https://developers.cloudflare.com/workers-ai/features/markdown-conversion/usage/binding/"><code>env.AI</code></a> binding:</p> <div><div data-nb-tabs data-nb-sync-key="workersExamples" class><div class="relative flex border-b border-border" role="tablist" data-nb-tabs-list><span class="bg-primary pointer-events-none absolute -bottom-px h-0.5 rounded-t-sm transition-[left,width] duration-200 ease-out" data-nb-tabs-indicator aria-hidden="true"></span></div><div class="mt-3"><div role="tabpanel" data-nb-tabs-content data-nb-tab-label="JavaScript" class><figure class="nb-code-figure" data-nb-lang="js"><pre class="astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz" tabindex="0" data-language="js" data-nb-lang="js"><code><span class="line"><span class="nb-shiki-1itgoe">await</span><span class="nb-shiki-140thh"> env.</span><span class="nb-shiki-dzsirb">AI</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-1t8gfj">toMarkdown</span><span class="nb-shiki-140thh">(</span></span> <span class="line"><span class="nb-shiki-140thh"> { name: </span><span class="nb-shiki-mdbnqw">"page.html"</span><span class="nb-shiki-140thh">, blob: </span><span class="nb-shiki-1itgoe">new</span><span class="nb-shiki-1t8gfj"> Blob</span><span class="nb-shiki-140thh">([html]) },</span></span> <span class="line"><span class="nb-shiki-140thh"> {</span></span> <span class="line"><span class="nb-shiki-140thh"> conversionOptions: {</span></span> <span class="line"><span class="nb-shiki-140thh"> output: { format: </span><span class="nb-shiki-mdbnqw">"text"</span><span class="nb-shiki-140thh"> },</span></span> <span class="line"><span class="nb-shiki-140thh"> },</span></span> <span class="line"><span class="nb-shiki-140thh"> },</span></span> <span class="line"><span class="nb-shiki-140thh">);</span></span></code></pre></figure></div><div role="tabpanel" data-nb-tabs-content data-nb-tab-label="TypeScript" class><figure class="nb-code-figure" data-nb-lang="typescript"><pre class="astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz" tabindex="0" data-language="typescript" data-nb-lang="typescript"><code><span class="line"><span class="nb-shiki-1itgoe">await</span><span class="nb-shiki-140thh"> env.</span><span class="nb-shiki-dzsirb">AI</span><span class="nb-shiki-140thh">.</span><span class="nb-shiki-1t8gfj">toMarkdown</span><span class="nb-shiki-140thh">(</span></span> <span class="line"><span class="nb-shiki-140thh"> { name: </span><span class="nb-shiki-mdbnqw">"page.html"</span><span class="nb-shiki-140thh">, blob: </span><span class="nb-shiki-1itgoe">new</span><span class="nb-shiki-1t8gfj"> Blob</span><span class="nb-shiki-140thh">([html]) },</span></span> <span class="line"><span class="nb-shiki-140thh"> {</span></span> <span class="line"><span class="nb-shiki-140thh"> conversionOptions: {</span></span> <span class="line"><span class="nb-shiki-140thh"> output: { format: </span><span class="nb-shiki-mdbnqw">"text"</span><span class="nb-shiki-140thh"> },</span></span> <span class="line"><span class="nb-shiki-140thh"> },</span></span> <span class="line"><span class="nb-shiki-140thh"> },</span></span> <span class="line"><span class="nb-shiki-140thh">);</span></span></code></pre></figure></div></div></div><script type="module" src="https://developers.cloudflare.com/home/runner/work/cloudflare-docs/cloudflare-docs/src/components/ui/tabs/Tabs.astro?astro&type=script&index=0&lang.ts"></script></div> <p>Or call the REST API:</p> <figure class="nb-code-figure" data-nb-lang="bash"><pre class="astro-code astro-code-themes github-light github-dark nb-shiki-c6xiwz" tabindex="0" data-language="bash" data-nb-lang="bash"><code><span class="line"><span class="nb-shiki-1t8gfj">curl</span><span class="nb-shiki-mdbnqw"> https://api.cloudflare.com/client/v4/accounts/{ACCOUNT_ID}/ai/tomarkdown</span><span class="nb-shiki-dzsirb"> \</span></span> <span class="line"><span class="nb-shiki-dzsirb"> -H</span><span class="nb-shiki-mdbnqw"> 'Authorization: Bearer {API_TOKEN}'</span><span class="nb-shiki-dzsirb"> \</span></span> <span class="line"><span class="nb-shiki-dzsirb"> -F</span><span class="nb-shiki-mdbnqw"> 'files=@index.html'</span><span class="nb-shiki-dzsirb"> \</span></span> <span class="line"><span class="nb-shiki-dzsirb"> -F</span><span class="nb-shiki-mdbnqw"> 'conversionOptions={"output": {"format": "text"}}'</span></span></code></pre></figure> <p>When you request text output, the <code>format</code> field of each result is set to <code>text</code>. For more details, refer to <a href="https://developers.cloudflare.com/workers-ai/features/markdown-conversion/conversion-options/#output">Conversion Options</a>.</p>
The text above is the source's. reef added the severity, the dates it could read from the text, and the endpoints and scopes named in code.