44c957f893c6bf5f5b7c78301de7b21c5975584d Thanks @ktym4a! - Fixes a bug where non-UTF-8 file names are not displayed when using relative paths in markdowns.a505190933365268d48139a5f197a3cfb5570870 Thanks @bluwy! - Fixes usage in browser environments by using subpath imports#9736 53c69dcc82cdf4000aff13a6c11fffe19096cf45 Thanks @bluwy! - Initializes internal cwdUrlStr variable lazily for performance, and workaround Rollup side-effect detection bug when building for non-Node runtimes
#9723 2f81cffa9da9db0e2802d303f94feaee8d2f54ec Thanks @blackmann! - Fixes a case where transformers wouldn't work on the class property
#9566 165cfc154be477337037185c32b308616d1ed6fa Thanks @OliverSpeir! - Allows remark plugins to pass options specifying how images in .md files will be optimized
#9643 e9a72d9a91a3741566866bcaab11172cb0dc7d31 Thanks @blackmann! - Adds a new markdown.shikiConfig.transformers config option. You can use this option to transform the Shikiji hast (AST format of the generated HTML) to customize the final HTML. Also updates Shikiji to the latest stable version.
See Shikiji's documentation for more details about creating your own custom transformers, and a list of common transformers you can add directly to your project.
270c6cc27 Thanks @lilnasy! - Fixes an issue where this package could not be installed alongside Astro 4.0.abf601233 Thanks @bluwy! - Updates the unified, remark, and rehype dependencies to latest. Make sure to update your custom remark and rehype plugins as well to be compatible with the latest versions.Potentially breaking change: The default value of markdown.remarkRehype.footnoteBackLabel is changed from "Back to content" to "Back to reference 1". See the mdast-util-to-hast commit for more information.
c7953645e Thanks @bluwy! - Removes deprecated APIs. All Astro packages had been refactored to not use these APIs.abf601233 Thanks @bluwy! - Updates the unified, remark, and rehype dependencies to latest. Make sure to update your custom remark and rehype plugins as well to be compatible with the latest versions.Potentially breaking change: The default value of markdown.remarkRehype.footnoteBackLabel is changed from "Back to content" to "Back to reference 1". See the mdast-util-to-hast commit for more information.
c7953645e Thanks @bluwy! - Removes deprecated APIs. All Astro packages had been refactored to not use these APIs.#9147 addb57c8e Thanks @bluwy! - Fixes RemarkRehype type's handler and handlers properties
Updated dependencies [abf601233, 6201bbe96, cdabf6ef0, 1c48ed286, 37697a2c5, bd0c2e9ae, 0fe3a7ed5, 710be505c, 153a5abb9]:
4537ecf0d Thanks @bluwy! - Exports createShikiHighlighter for low-level syntax highlighting usagec5010aad3 Thanks @horo-fox! - Adds experimental support for multiple shiki themes with the new markdown.shikiConfig.experimentalThemes option.c4270e476 Thanks @bluwy! - Updates the internal shiki syntax highlighter to shikiji, an ESM-focused alternative that simplifies bundling and maintenance.There are no new options and no changes to how you author code blocks and syntax highlighting.
Potentially breaking change: While this refactor should be transparent for most projects, the transition to shikiji now produces a smaller HTML markup by attaching a fallback color style to the pre or code element, instead of to the line span directly. For example:
Before:
<code class="astro-code" style="background-color: #24292e">
<pre>
<span class="line" style="color: #e1e4e8">my code</span>
</pre>
</code>
After:
<code class="astro-code" style="background-color: #24292e; color: #e1e4e8">
<pre>
<span class="line">my code<span>
</pre>
</code>
This does not affect the colors as the span will inherit the color from the parent, but if you're relying on a specific HTML markup, please check your site carefully after upgrading to verify the styles.
2993055be, c4270e476, bd5aa1cd3, f369fa250, 391729686, f999365b8, b2ae9ee0c, 0abff97fe, 3bef32f81]:
#8715 21f482657 Thanks @cprass! - Remove is:raw from remark Shiki plugin
#8737 6f60da805 Thanks @ematipico! - Add provenance statement when publishing the library from CI
Updated dependencies [6f60da805, d78806dfe, d1c75fe15, aa265d730, 78adbc443, 21e0757ea, 357270f2a]:
#8475 d93987824 Thanks @webpro! - feat(markdown): Add support for imageReference paths when collecting images
#8532 7522bb491 Thanks @bluwy! - Export createMarkdownProcessor and deprecate renderMarkdown API
7522bb491, ecc65abbf, 2c4fc878b, c92e0acd7, f95febf96, b85c8a78a, 45364c345]:
#8179 6011d52d3 Thanks @matthewp! - Astro 3.0 Release Candidate
#8169 e79e3779d Thanks @bluwy! - Remove pre-shiki v0.14 theme names for compatibility. Please rename to the new theme names to migrate:
material-darker -> material-theme-darkermaterial-default -> material-themematerial-lighter -> material-theme-lightermaterial-ocean -> material-theme-oceanmaterial-palenight -> material-theme-palenightd0679a666, db39206cb, adf9fccfd, 0c7b42dc6, 46c4c0e05, 364d861bd, 2484dc408, 81545197a, 6011d52d3, c2c71d90c, cd2d7e769, 80f1494cd, e45f30293, c0de7a7b0, 65c354969, 3c3100851, 34cb20021, a824863ab, 44f7a2872, 1048aca55, be6bbd2c8, 9e021a91c, 7511a4980, c37632a20, acf652fc1, 42785c7b7, 8450379db, dbc97b121, 7d2f311d4, 2540feedb, ea7ff5177, 68efd4a8b, 7bd1b86f8, 036388f66, 519a1c4e8, 1f58a7a1b, 2ae9d37f0, a8f35777e, 70f34f5a3, 5208a3c8f, 84af8ed9d, f003e7364, ffc9e2d3d, 732111cdc, 0f637c71e, 33b8910cf, 8a5b0c1f3, 148e61d24, e79e3779d, 632579dc2, 3674584e0, 1db4e92c1, e7f872e91, 16f09dfff, 4477bb41c, 55c10d1d5, 3e834293d, 96beb883a, 997a0db8a, 80f1494cd, 0f0625504, e1ae56e72, f32d093a2, f01eb585e, b76c166bd, a87cbe400, 866ed4098, 767eb6866, 32669cd47]:
#8179 6011d52d3 Thanks @matthewp! - Astro 3.0 Release Candidate
#8169 e79e3779d Thanks @bluwy! - Remove pre-shiki v0.14 theme names for compatibility. Please rename to the new theme names to migrate:
material-darker -> material-theme-darkermaterial-default -> material-themematerial-lighter -> material-theme-lightermaterial-ocean -> material-theme-oceanmaterial-palenight -> material-theme-palenightadf9fccfd, 582132328, 81545197a, 6011d52d3, be6bbd2c8, 42785c7b7, 95120efbe, 2ae9d37f0, f003e7364, 732111cdc, 33b8910cf, e79e3779d, 179796405, a87cbe400, 767eb6866]:
1eae2e3f7, 76ddef19c, 9b4f70a62, 3fdf509b2, 2f951cd40, c022a4217, 67becaa58, bc37331d8, dfc2d93e3, 3dc1ca2fa, 1be84dfee, 35f01df79, 3fdf509b2, 78de801f2, 59d6e569f, 7723c4cc9, fb5cd6b56, 631b9c410]:
#7104 826e02890 Thanks @bluwy! - Specify "files" field to only publish necessary files
Updated dependencies [4516d7b22, e186ecc5e, c6d7ebefd, 914c439bc, e9fc2c221, 075eee08f, 719002ca5, fc52681ba, fb84622af, cada10a46, cd410c5eb, 73ec6f6c1, 410428672, 763ff2d1e, c1669c001, 3d525efc9, 826e02890]:
49514e4ce Thanks @bluwy! - Upgrade shiki to v0.14.1. This updates the shiki theme colors and adds the theme name to the pre tag, e.g. <pre class="astro-code github-dark">.818252acd, 80e3d4d3d, 3326492b9, cac4a321e, 831b67cdb, 49514e4ce, 0883fd487]:
#6824 2511d58d5 Thanks @Princesseuh! - Add support for using optimized and relative images in MDX files with experimental.assets
Updated dependencies [8539eb164, a9c22994e, 948a6d7be]:
#6744 a1a4f45b5 Thanks @Princesseuh! - Fix remote images in Markdown throwing errors when using experimental.assets
Updated dependencies [489dd8d69, a1a4f45b5, a1108e037, 8b88e4cf1, d54cbe413, 4c347ab51, ff0430786, 2f2e572e9, 7116c021a]:
#6604 7f7a8504b Thanks @Princesseuh! - Fix using optimized images in Markdown not working
Updated dependencies [7f7a8504b, 38e6ec21e, f42f47dc6]:
#6559 90e5f87d0 Thanks @Princesseuh! - Vendor image-size to fix CJS-related issues
#6555 f5fddafc2 Thanks @Princesseuh! - Add a validateOptions hook to the Image Service API in order to set default options and validate the passed options
Updated dependencies [04dddd783, ea9b3dd72, bf024cb34, 22955b895, f413446a8, 90e5f87d0, 388190102, 035c0c4df, f112c12b1, 689884251, fa132e35c, f5fddafc2, 283734525, 66858f1f2, 6c465e958]:
694918a56 Thanks @Princesseuh! - Add a new experimental flag (experimental.assets) to enable our new core Assets story.This unlocks a few features:
See Assets (Experimental) on our docs site for more information on how to use this feature!
afbbc4d5b Thanks @Princesseuh! - Updated compilation settings to disable downlevelling for Node 14fec583909, b087b83fe, 694918a56, a20610609, a4a74ab70, 75921b3cd, afbbc4d5b]:
#5978 7abb1e905 Thanks @HiDeoo! - Fix MDX heading IDs generation when using a frontmatter reference
Updated dependencies [b53e0717b, 60b32d585, 883e0cc29, dabce6b8c, aedf23f85]:
e2019be6f Thanks @bholmesdev! - Give remark and rehype plugins access to user frontmatter via frontmatter injection. This means data.astro.frontmatter is now the complete Markdown or MDX document's frontmatter, rather than an empty object.This allows plugin authors to modify existing frontmatter, or compute new properties based on other properties. For example, say you want to compute a full image URL based on an imageSrc slug in your document frontmatter:
export function remarkInjectSocialImagePlugin() {
return function (tree, file) {
const { frontmatter } = file.data.astro;
frontmatter.socialImageSrc = new URL(frontmatter.imageSrc, 'https://my-blog.com/').pathname;
};
}
When using Content Collections, you can access this modified frontmatter using the remarkPluginFrontmatter property returned when rendering an entry.
Migration instructions
Plugin authors should now check for user frontmatter when applying defaults.
For example, say a remark plugin wants to apply a default title if none is present. Add a conditional to check if the property is present, and update if none exists:
export function remarkInjectTitlePlugin() {
return function (tree, file) {
const { frontmatter } = file.data.astro;
+ if (!frontmatter.title) {
frontmatter.title = 'Default title';
+ }
}
}
This differs from previous behavior, where a Markdown file's frontmatter would always override frontmatter injected via remark or reype.
#5785 16107b6a1 Thanks @delucis! - Drop support for legacy Astro-flavored Markdown
#5684 a9c292026 & #5769 93e633922 Thanks @bholmesdev! - Refine Markdown and MDX configuration options for ease-of-use.
Markdown
Replace the extendDefaultPlugins option with a gfm boolean and a smartypants boolean. These are enabled by default, and can be disabled to remove GitHub-Flavored Markdown and SmartyPants.
Ensure GitHub-Flavored Markdown and SmartyPants are applied whether or not custom remarkPlugins or rehypePlugins are configured. If you want to apply custom plugins and remove Astro's default plugins, manually set gfm: false and smartypants: false in your config.
Migrate extendDefaultPlugins to gfm and smartypants
You may have disabled Astro's built-in plugins (GitHub-Flavored Markdown and Smartypants) with the extendDefaultPlugins option. This has now been split into 2 flags to disable each plugin individually:
markdown.gfm to disable GitHub-Flavored Markdownmarkdown.smartypants to disable SmartyPants
// astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({
markdown: {
- extendDefaultPlugins: false,
+ smartypants: false,
+ gfm: false,
}
});
Additionally, applying remark and rehype plugins no longer disables gfm and smartypants. You will need to opt-out manually by setting gfm and smartypants to false.
MDX
Support all Markdown configuration options (except drafts) from your MDX integration config. This includes syntaxHighlighting and shikiConfig options to further customize the MDX renderer.
Simplify extendPlugins to an extendMarkdownConfig option. MDX options will default to their equivalent in your Markdown config. By setting extendMarkdownConfig to false, you can "eject" to set your own syntax highlighting, plugins, and more.
Migrate MDX's extendPlugins to extendMarkdownConfig
You may have used the extendPlugins option to manage plugin defaults in MDX. This has been replaced by 3 flags:
extendMarkdownConfig (true by default) to toggle Markdown config inheritance. This replaces the extendPlugins: 'markdown' option.gfm (true by default) and smartypants (true by default) to toggle GitHub-Flavored Markdown and SmartyPants in MDX. This replaces the extendPlugins: 'defaults' option.#5825 52209ca2a Thanks @bholmesdev! - Baseline the experimental contentCollections flag. You're free to remove this from your astro config!
import { defineConfig } from 'astro/config';
export default defineConfig({
- experimental: { contentCollections: true }
})
#5806 7572f7402 Thanks @matthewp! - Make astro a peerDependency of integrations
This marks astro as a peerDependency of several packages that are already getting major version bumps. This is so we can more properly track the dependency between them and what version of Astro they are being used with.
Patch Changes
#5837 12f65a4d5 Thanks @giuseppelt! - fix shiki css class replace logic
Updated dependencies [93e633922, 16dc36a87, 01f3f463b, e2019be6f, 05caf445d, 49ab4f231, a342a486c, 8fb28648f, 1f92d64ea, c2180746b, ae8a012a7, cf2de5422, ce5c5dbd4, ec09bb664, 665a2c222, 259a539d7, f7aa1ec25, 4987d6f44, 304823811, 302e0ef8f, 55cea0a9d, dd56c1941, 9963c6e4d, be901dc98, f6cf92b48, e818cc046, 8c100a6fe, 116d8835c, 840412128, 1f49cddf9, 7325df412, 16c7d0bfd, a9c292026, 2a5786419, 4a1cabfe6, a8d3e7924, fa8c131f8, 64b8082e7, c4b0cb8bf, 23dc9ea96, 63a6ceb38, a3a7fc929, 52209ca2a, 5fd9208d4, 5eba34fcc, 899214298, 3a00ecb3e, 5eba34fcc, 2303f9514, 1ca81c16b, b66d7195c]:
16107b6a1`](https://github.com/withastro/astro/commit/16107b6a10) Thanks [@delucis](https://github.com/delucis)! - Drop support for legacy Astro-flavored Markdown
- [#5825](https://github.com/withastro/astro/pull/5825) [`52209ca2a`](https://github.com/withastro/astro/commit/52209ca2ad) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Baseline the experimental `contentCollections` flag. You're free to remove this from your astro config!
```diff
import { defineConfig } from 'astro/config';
export default defineConfig({
- experimental: { contentCollections: true }
})
```
- [#5806](https://github.com/withastro/astro/pull/5806) [`7572f7402`](https://github.com/withastro/astro/commit/7572f74022) Thanks [@matthewp](https://github.com/matthewp)! - Make astro a peerDependency of integrations
This marks `astro` as a peerDependency of several packages that are already getting `major` version bumps. This is so we can more properly track the dependency between them and what version of Astro they are being used with.
### Patch Changes
- [#5837](https://github.com/withastro/astro/pull/5837) [`12f65a4d5`](https://github.com/withastro/astro/commit/12f65a4d55) Thanks [@giuseppelt](https://github.com/giuseppelt)! - fix shiki css class replace logic
- Updated dependencies [[`01f3f463b`](https://github.com/withastro/astro/commit/01f3f463bf), [`1f92d64ea`](https://github.com/withastro/astro/commit/1f92d64ea3), [`c2180746b`](https://github.com/withastro/astro/commit/c2180746b4), [`ae8a012a7`](https://github.com/withastro/astro/commit/ae8a012a7b), [`cf2de5422`](https://github.com/withastro/astro/commit/cf2de5422c), [`ec09bb664`](https://github.com/withastro/astro/commit/ec09bb6642), [`665a2c222`](https://github.com/withastro/astro/commit/665a2c2225), [`f7aa1ec25`](https://github.com/withastro/astro/commit/f7aa1ec25d), [`302e0ef8f`](https://github.com/withastro/astro/commit/302e0ef8f5), [`840412128`](https://github.com/withastro/astro/commit/840412128b), [`1f49cddf9`](https://github.com/withastro/astro/commit/1f49cddf9e), [`4a1cabfe6`](https://github.com/withastro/astro/commit/4a1cabfe6b), [`c4b0cb8bf`](https://github.com/withastro/astro/commit/c4b0cb8bf2), [`23dc9ea96`](https://github.com/withastro/astro/commit/23dc9ea96a), [`63a6ceb38`](https://github.com/withastro/astro/commit/63a6ceb38d), [`52209ca2a`](https://github.com/withastro/astro/commit/52209ca2ad), [`2303f9514`](https://github.com/withastro/astro/commit/2303f95142)]:
- astro@2.0.0-beta.2
- @astrojs/prism@2.0.0-beta.0
93e633922`](https://github.com/withastro/astro/commit/93e633922c) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Introduce a `smartypants` flag to opt-out of Astro's default SmartyPants plugin.
```js
{
markdown: {
smartypants: false,
}
}
```
#### Migration
You may have disabled Astro's built-in plugins (GitHub-Flavored Markdown and Smartypants) with the `extendDefaultPlugins` option. This has now been split into 2 flags to disable each plugin individually:
- `markdown.gfm` to disable GitHub-Flavored Markdown
- `markdown.smartypants` to disable SmartyPants
```diff
// astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({
markdown: {
- extendDefaultPlugins: false,
+ smartypants: false,
+ gfm: false,
}
});
```
e2019be6f`](https://github.com/withastro/astro/commit/e2019be6ff) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Give remark and rehype plugins access to user frontmatter via frontmatter injection. This means `data.astro.frontmatter` is now the _complete_ Markdown or MDX document's frontmatter, rather than an empty object.
This allows plugin authors to modify existing frontmatter, or compute new properties based on other properties. For example, say you want to compute a full image URL based on an `imageSrc` slug in your document frontmatter:
```ts
export function remarkInjectSocialImagePlugin() {
return function (tree, file) {
const { frontmatter } = file.data.astro;
frontmatter.socialImageSrc = new URL(frontmatter.imageSrc, 'https://my-blog.com/').pathname;
};
}
```
#### Content Collections - new `remarkPluginFrontmatter` property
We have changed _inject_ frontmatter to _modify_ frontmatter in our docs to improve discoverability. This is based on support forum feedback, where "injection" is rarely the term used.
To reflect this, the `injectedFrontmatter` property has been renamed to `remarkPluginFrontmatter`. This should clarify this plugin is still separate from the `data` export Content Collections expose today.
#### Migration instructions
Plugin authors should now **check for user frontmatter when applying defaults.**
For example, say a remark plugin wants to apply a default `title` if none is present. Add a conditional to check if the property is present, and update if none exists:
```diff
export function remarkInjectTitlePlugin() {
return function (tree, file) {
const { frontmatter } = file.data.astro;
+ if (!frontmatter.title) {
frontmatter.title = 'Default title';
+ }
}
}
```
This differs from previous behavior, where a Markdown file's frontmatter would _always_ override frontmatter injected via remark or reype.
- [#5684](https://github.com/withastro/astro/pull/5684) [`a9c292026`](https://github.com/withastro/astro/commit/a9c2920264) Thanks [@bholmesdev](https://github.com/bholmesdev)! - Refine Markdown and MDX configuration options for ease-of-use.
#### Markdown
- **Remove `remark-smartypants`** from Astro's default Markdown plugins.
- **Replace the `extendDefaultPlugins` option** with a simplified `gfm` boolean. This is enabled by default, and can be disabled to remove GitHub-Flavored Markdown.
- Ensure GitHub-Flavored Markdown is applied whether or not custom `remarkPlugins` or `rehypePlugins` are configured. If you want to apply custom plugins _and_ remove GFM, manually set `gfm: false` in your config.
#### MDX
- Support _all_ Markdown configuration options (except `drafts`) from your MDX integration config. This includes `syntaxHighlighting` and `shikiConfig` options to further customize the MDX renderer.
- Simplify `extendDefaults` to an `extendMarkdownConfig` option. MDX options will default to their equivalent in your Markdown config. By setting `extendMarkdownConfig` to false, you can "eject" to set your own syntax highlighting, plugins, and more.
#### Migration
To preserve your existing Markdown and MDX setup, you may need some configuration changes:
##### Smartypants manual installation
[Smartypants](https://github.com/silvenon/remark-smartypants) has been removed from Astro's default setup. If you rely on this plugin, [install `remark-smartypants`](https://github.com/silvenon/remark-smartypants#installing) and apply to your `astro.config.*`:
```diff
// astro.config.mjs
import { defineConfig } from 'astro/config';
+ import smartypants from 'remark-smartypants';
export default defineConfig({
markdown: {
+ remarkPlugins: [smartypants],
}
});
```
##### Migrate `extendDefaultPlugins` to `gfm`
You may have disabled Astro's built-in plugins (GitHub-Flavored Markdown and Smartypants) with the `extendDefaultPlugins` option. Since Smartypants has been removed, this has been renamed to `gfm`.
```diff
// astro.config.mjs
import { defineConfig } from 'astro/config';
export default defineConfig({
markdown: {
- extendDefaultPlugins: false,
+ gfm: false,
}
});
```
Additionally, applying remark and rehype plugins **no longer disables** `gfm`. You will need to opt-out manually by setting `gfm` to `false`.
##### Migrate MDX's `extendPlugins` to `extendMarkdownConfig`
You may have used the `extendPlugins` option to manage plugin defaults in MDX. This has been replaced by 2 flags:
- `extendMarkdownConfig` (`true` by default) to toggle Markdown config inheritance. This replaces the `extendPlugins: 'markdown'` option.
- `gfm` (`true` by default) to toggle GitHub-Flavored Markdown in MDX. This replaces the `extendPlugins: 'defaults'` option.
The rehypeHeadingIds plugin injects IDs for all headings in a Markdown document and can now also handle MDX inputs if needed. You can import and use this plugin if you need heading IDs to be injected before other rehype plugins run.
853081d1c Thanks @bholmesdev! - Prevent relative image paths in src/content/#4842 812658ad2 Thanks @bluwy! - Fix non-hoisted remark/rehype plugin loading
#4842 812658ad2 Thanks @bluwy! - Add missing dependencies, support strict dependency installation (e.g. pnpm)
#4474 ac0321824 Thanks @bholmesdev! - Add "extends" to markdown plugin config to preserve Astro defaults
#4138 839097c84 Thanks @gtnbssn! - Makes remark-rehype options available in astro.config.mjs
#4474 ac0321824 Thanks @bholmesdev! - Add "extends" to markdown plugin config to preserve Astro defaults
#4138 839097c84 Thanks @gtnbssn! - Makes remark-rehype options available in astro.config.mjs
04ad44563 - > Astro v1.0 is out! Read the official announcement post.No breaking changes. This package is now officially stable and compatible with astro@1.0.0!
#4176 2675b8633 Thanks @bholmesdev! - Support frontmatter injection for MD and MDX using remark and rehype plugins
#4137 471c6f784 Thanks @bholmesdev! - Speed up internal markdown builds with new vite-plugin markdown
#4169 16034f0dd Thanks @hippotastic! - Fix double-escaping of non-highlighted code blocks in Astro-flavored markdown
64432bcb8 Thanks @Princesseuh! - Refactor @astrojs/mdx and @astrojs/markdown-remark to use @astrojs/prism instead of duplicating the codeba11b3399 Thanks @RafidMuhymin! - fixed generated slugs in markdown that ends with a dash
#4016 00fab4ce1 Thanks @bholmesdev! - The use of components and JSX expressions in Markdown are no longer supported by default.
For long term support, migrate to the @astrojs/mdx integration for MDX support (including .mdx pages!).
Not ready to migrate to MDX? Add the legacy flag to your Astro config to re-enable the previous Markdown support.
// https://astro.build/config
export default defineConfig({
legacy: {
astroFlavoredMarkdown: true,
},
});
6e27a5fdc Thanks @natemoo-re! - BREAKING Renamed Markdown utility function getHeaders() to getHeadings().399d7e269 Thanks @bholmesdev! - Avoid parsing JSX, components, and Astro islands when using "plain" md mode. This brings markdown.mode: 'md' in-line with our docs description.07fb544da Thanks @FredKSchott! - Remove unused ssr-utils file01a55467d Thanks @FredKSchott! - Add back missing ssr-utils.js file#3911 ca45c0c27 Thanks @JuanM04! - Don't throw when Shiki doesn't recognize a language
Updated dependencies [b48767985]:
93e1020b1 Thanks @natemoo-re! - Tooling: reintroduce smoke test across example projects#3638 80c71c7c Thanks @tony-sull! - Fix: HTML comments in markdown code blocks should not be wrapped in JS comments
#3612 fca58cfd Thanks @bholmesdev! - Fix: "vpath" import error when building for netlify edge
#3630 48e67fe0 Thanks @tony-sull! - Encodes ampersand characters in code blocks
#3620 05aa7244 Thanks @hippotastic! - Remove extra newlines around Markdown components
5c73f614 Thanks @hippotastic! - Fix remarkMdxish performance issue on huge sites#3564 76fb01cf Thanks @hippotastic! - Fix autolinking of URLs inside links
#3554 c549f161 Thanks @hippotastic! - Allow AlpineJS syntax extensions in Markdown
#3514 6c955ca6 Thanks @hippotastic! - Fix Markdown errors missing source filename
#3516 30578015 Thanks @hippotastic! - Fix: Allow self-closing tags in Markdown
119ecf8d Thanks @hippotastic! - Fix components in markdown regressions51db2b9b Thanks @bholmesdev! - Fix: markdown imports failing due to internal dependency issuecfae9760 Thanks @natemoo-re! - Significantally more stable behavior for "Markdown + Components" usage, which now handles component serialization much more similarly to MDX. Also supports switching between Components and Markdown without extra newlines, removes wrapping <p> tags from standalone components, and improves JSX expression handling.#3234 de123b28 Thanks @JuanM04! - Removed rehype-slug in favor of our own implementation. The behavior of the slugging should remain the same
#3234 de123b28 Thanks @JuanM04! - Moved some type from astro to @astrojs/markdown-remark
9ba1f4f8 Thanks @bholmesdev! - Fix JSX expression inconsistencies within markdown filesef198ff8 Thanks @FredKSchott! - shiki: Add diff symbol handling to disable user-select on +/- symbols.53162534 Thanks @FredKSchott! - - Removed renderMarkdownWithFrontmatter because it wasn't being used
renderMarkdown are now required — see the exported interface AstroMarkdownOptionse425f896 Thanks @FredKSchott! - Update config options to respect RFC00190a3d3e51 Thanks @bholmesdev! - Change shiki to our default markdown syntax highlighter. This includes updates to all relevant starter projects that used Prism-specific styles.#2870 d763ec18 Thanks @FredKSchott! - Fix a shiki performance issue affecting large sites
Updated dependencies [2db97f10]:
#2870 d763ec18 Thanks @FredKSchott! - Fix a shiki performance issue affecting large sites
Updated dependencies [2db97f10]:
0a3d3e51 Thanks @bholmesdev! - Change shiki to our default markdown syntax highlighter. This includes updates to all relevant starter projects that used Prism-specific styles.91765d79 Thanks @FredKSchott! - Improve performance by optimizing calls to getHighlighter#2534 cfeaa941 Thanks @JuanM04! - Now you can use local plugins by passing a function instead of an import
#2518 2bc91543 Thanks @JuanM04! - Added the ability to use custom themes and langs with Shiki (<Code /> and @astrojs/markdown-remark)
#2497 6fe1b027 Thanks @JuanM04! - Add Shiki as an alternative to Prism
#2518 2bc91543 Thanks @JuanM04! - Added wrap to Shiki config
#2564 d71c4620 Thanks @JuanM04! - Fixed curly braces inside Shiki codeblocks
#2534 cfeaa941 Thanks @JuanM04! - Now you can use local plugins by passing a function instead of an import
#2518 2bc91543 Thanks @JuanM04! - Added the ability to use custom themes and langs with Shiki (<Code /> and @astrojs/markdown-remark)
#2518 2bc91543 Thanks @JuanM04! - Added wrap to Shiki config
45cea6ae Thanks @jonathantneal! - Officially drop support for Node v12. The minimum supported version is now Node v14.15+,679d4395: - Upgraded dependencies
remark-slug with rehype-slug because it was deprecated@silvenon/remark-smartypants with remark-smartypants because its name was changedremark-footnotes because remark-gfm now supports footnotesremark-smartypants and rehype-slug to the default plugins liste6aaeff5: Initial release.00d2b625: Move gray-matter to deps7eaabbb0: Fix bug where code blocks would not be escaped properlyd84bfe71: Adds prism support within the Markdown plugin.b03f8771: Fix parsing of an empty <pre></pre> tag in markdown files, which expected the pre tag to have a childb03f8771: Fix the importing of unified Plugin and UnifiedPlugin types397d8f3d: Upgrade @astrojs/markdown-support dependencies. The remark-rehype@9 upgrade enables accessible footnotes with remark-footnotes.a421329f: Fix the left-brace issue460e625: Move remaining missing dependencies70f0a09: Added remark-slug to default pluginsd396943: 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
remarkPluginsorrehypePluginsremoves Astro's built-in support for GitHub-flavored Markdown support, Footnotes syntax, Smartypants. You must explicitly add these plugins to yourastro.config.mjsfile, if desired.
export default {
markdownOptions: {
remarkPlugins: ['remark-slug', ['remark-autolink-headings', { behavior: 'prepend' }]],
rehypePlugins: ['rehype-slug', ['rehype-autolink-headings', { behavior: 'prepend' }]],
},
};
f9f2da4: Add repository key to all package.json50e6f49: Fixes issues with using astro via the create script