diff options
author | 2021-08-11 18:52:27 -0300 | |
---|---|---|
committer | 2021-08-11 16:52:27 -0500 | |
commit | 2321b577ee079836e543843ee9300cf19f9d567f (patch) | |
tree | f4f150a9f5597f413bf01a59418da18d4ca37a8d /packages/markdown-support | |
parent | 3f093fa830f4f971423867915b0926ed909748a1 (diff) | |
download | astro-2321b577ee079836e543843ee9300cf19f9d567f.tar.gz astro-2321b577ee079836e543843ee9300cf19f9d567f.tar.zst astro-2321b577ee079836e543843ee9300cf19f9d567f.zip |
Fixes #1033 - Markdown with applied scopedStyles doesn't run Prism syntax highlight (#1037)
* Fixes #1033 - Markdown with applied scopedStyles doesn't run Prism syntax highlight
* Removed the incorrect lang attribute to indicate language syntax
* Fixed UT for scopedStyles + markdown
* Update packages/astro/test/astro-markdown.test.js
Co-authored-by: Caleb Jasik <calebjasik@jasik.xyz>
* Added changeset for PR #1037
* Update curly-queens-pay.md
Changing from a `minor` release to a `patch` since we're pre-v1.0.0! This
Co-authored-by: Vitor Calejuri <vitor.cajuleri@gmail.com>
Co-authored-by: Caleb Jasik <calebjasik@jasik.xyz>
Co-authored-by: Nate Moore <natemoo-re@users.noreply.github.com>
Diffstat (limited to 'packages/markdown-support')
-rw-r--r-- | packages/markdown-support/src/index.ts | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/packages/markdown-support/src/index.ts b/packages/markdown-support/src/index.ts index 5278d44d6..86d95a414 100644 --- a/packages/markdown-support/src/index.ts +++ b/packages/markdown-support/src/index.ts @@ -4,7 +4,7 @@ import createCollectHeaders from './rehype-collect-headers.js'; import scopedStyles from './remark-scoped-styles.js'; import remarkExpressions from './remark-expressions.js'; import rehypeExpressions from './rehype-expressions.js'; -import { rehypeCodeBlock } from './codeblock.js'; +import { remarkCodeBlock, rehypeCodeBlock } from './codeblock.js'; import { loadPlugins } from './load-plugins.js'; import raw from 'rehype-raw'; @@ -56,6 +56,7 @@ export async function renderMarkdown(content: string, opts?: MarkdownRenderingOp parser.use(scopedStyles(scopedClassName)); } + parser.use(remarkCodeBlock()); parser.use(markdownToHtml, { allowDangerousHtml: true, passThrough: ['raw', 'mdxTextExpression'] }); parser.use(rehypeExpressions); |