#Astro Marked Conflict?
1 messages · Page 1 of 1 (latest)
Hmm, I don't know enough to give you a confident answer yet. However, I can tell you that Astro does not include built-in support for remote Markdown. To fetch remote Markdown and render it to HTML, you will need to install and configure your own Markdown parser from npm. This will not inherit from any of Astro’s built-in Markdown and MDX settings that you have configured. Be sure that you understand these limitations before implementing this in your project.
Here is an example of how to use "marked" to parse markdown in Astro:
---// Example: Fetch Markdown from a remote API// and render it to HTML, at runtime.// Using "marked" (<https://github.com/markedjs/marked>)import { marked } from 'marked';const response = await fetch('<https://raw.githubusercontent.com/wiki/adam-p/markdown-here/Markdown-Cheatsheet.md'>);const markdown = await response.text();const content = marked.parse(markdown);---<article set:html={content} />
(Source: Astro Documentation (https://docs.astro.build/en/guides/markdown-content/))