Basic Usage
Markdown
gives you the ability to write markdown in an .astro
file.
---import { Markdown } from '@splendidlabz/astro'---<Markdown> ## Markdown Heading 2
You can write **markdown** *content* inside this component.</Markdown>
<h2 id="markdown-heading-2">Markdown Heading 2</h2><p> You can write <strong>markdown</strong> <em>content</em> inside this component.</p>
Markdown Heading 2
You can write markdown content inside this component.
Inline Markdown Content
If you want Markdown
to create content without a <p>
wrapper, write your content in Markdown
without a new line.
<Markdown>Hello world</Markdown>
Hello world
Hello world
Usage with Prettier
If you use Prettier, you’ll need to ignore the Markdown block because Prettier tends to mangle markdown content — causing them to be incorrect.
<!-- prettier-ignore --><Markdown> Paragraph 1
Paragraph 2</Markdown>
<!-- After prettier, without ignoring --><Markdown>Paragraph 1 Paragraph 2</Markdown>