#Astro Marked Conflict?

1 messages · Page 1 of 1 (latest)

toxic spindleBOT
#

Hi @wanton gate. I'm kapa.ai, your friendly support bot. I will try to answer your question by searching through the knowledge base. :wave:

#

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/))

If you're still having trouble, I would recommend checking the documentation for both Astro and marked.js, or consider opening an issue on the Astro GitHub page.

Note: you can ask me a follow up question by @ mentioning me again :speech_balloon: