0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-06 22:10:10 -05:00
astro/.changeset/clever-cheetahs-jump.md
Pavel Mineev d3969436dc
Remark and rehype plugins (#562)
* remark plugins

* remove unused dependency

* enable codeblocks

* backward compatibility with remark-code-titles

* add support for rehype plugins

* add proper types for plugins

* fixes after review

- connect plugins by name
- make plugins configurable
- connect gfm and footnotes if no plugins provided from config
- add more plugins to example

* update and rename example

* add documentation for markdown plugins

* chore: rename with-markdown-plugins example

* chore: restructure dependencies

* feat: add back smartypants, fix mdx expressions

* chore: remove log

* test: add markdown plugin tests

* chore: add changeset

* docs: update markdown doc

Co-authored-by: Nate Moore <nate@skypack.dev>
2021-07-01 11:55:22 -05:00

1.1 KiB

astro @astrojs/markdown-support
minor minor

Add support for remark and rehype plugins for both .md pages and .astro pages using the <Markdown> component.

For example, the astro.config.mjs could be updated to include the following. Read the Markdown documentation for more information.

Note

Enabling custom remarkPlugins or rehypePlugins removes Astro's built-in support for GitHub-flavored Markdown support, Footnotes syntax, Smartypants. You must explicitly add these plugins to your astro.config.mjs file, if desired.

export default {
  markdownOptions: {
    remarkPlugins: [
      'remark-slug',
      ['remark-autolink-headings', { behavior: 'prepend'}],
    ],
    rehypePlugins: [
      'rehype-slug',
      ['rehype-autolink-headings', { behavior: 'prepend'}],
    ]
  },
}