@astrojs/markdown-remark
π Patch Changes
- Updated dependencies [
240c317]:- @astrojs/internal-helpers@0.8.0-beta.0
- Updated dependencies [
πΏ Minor Changes
- #15277
cb99214Thanks @ematipico! - Fixes an issue where the functioncreateShikiHighlighterwould always create a new Shiki highlighter instance. Now the function returns a cached version of the highlighter based on the Shiki options. This should improve the performance for sites that heavily rely on Shiki and code in their pages.
π Patch Changes
- Updated dependencies [
11efb05]:- @astrojs/prism@4.0.0-beta.2
- #15277
π Patch Changes
- #14902
d8305f8Thanks @tuyuritio! - Prevents HAST-only props from being directly converted into HTML attributes
- #14902
π Patch Changes
- Updated dependencies [
b8ca69b]:- @astrojs/internal-helpers@0.7.4
- Updated dependencies [
π Patch Changes
- Updated dependencies [
1e2499e]:- @astrojs/internal-helpers@0.7.3
- Updated dependencies [
π Patch Changes
- Updated dependencies [
4d16de7]:- @astrojs/internal-helpers@0.7.2
- Updated dependencies [
π Patch Changes
- Updated dependencies [
0567fb7]:- @astrojs/internal-helpers@0.7.1
- Updated dependencies [
π Patch Changes
- Updated dependencies [
f4e8889]:- @astrojs/internal-helpers@0.7.0
- Updated dependencies [
π Patch Changes
-
#13941
6bd5f75Thanks @aditsachde! - Adds support for TOML files to Astroβs built-inglob()andfile()content loaders.In Astro 5.2, Astro added support for using TOML frontmatter in Markdown files instead of YAML. However, if you wanted to use TOML files as local content collection entries themselves, you needed to write your own loader.
Astro 5.12 now directly supports loading data from TOML files in content collections in both the
glob()and thefile()loaders.If you had added your own TOML content parser for the
file()loader, you can now remove it as this functionality is now included:src/content.config.ts import { defineCollection } from "astro:content";import { file } from "astro/loaders";import { parse as parseToml } from "toml";const dogs = defineCollection({loader: file("src/data/dogs.toml", { parser: (text) => parseToml(text) }),loader: file("src/data/dogs.toml")schema: /* ... */})Note that TOML does not support top-level arrays. Instead, the
file()loader considers each top-level table to be an independent entry. The table header is populated in theidfield of the entry object.See Astroβs content collections guide for more information on using the built-in content loaders.
-
π Patch Changes
- Updated dependencies [
3c3b492]:- @astrojs/prism@3.3.0
- Updated dependencies [
πΏ Minor Changes
-
#13352
cb886dcThanks @delucis! - Adds support for a newexperimental.headingIdCompatflagBy default, Astro removes a trailing
-from the end of IDs it generates for headings ending with special characters. This differs from the behavior of common Markdown processors.You can now disable this behavior with a new configuration flag:
astro.config.mjs import { defineConfig } from 'astro/config';export default defineConfig({experimental: {headingIdCompat: true,},});This can be useful when heading IDs and anchor links need to behave consistently across your site and other platforms such as GitHub and npm.
If you are using the
rehypeHeadingIdsplugin directly, you can also pass this new option:astro.config.mjs import { defineConfig } from 'astro/config';import { rehypeHeadingIds } from '@astrojs/markdown-remark';import { otherPluginThatReliesOnHeadingIDs } from 'some/plugin/source';export default defineConfig({markdown: {rehypePlugins: [[rehypeHeadingIds, { experimentalHeadingIdCompat: true }],otherPluginThatReliesOnHeadingIDs,],},}); -
#13311
a3327ffThanks @chrisirhc! - Adds a new configuration option for Markdown syntax highlightingexcludeLangsThis option provides better support for diagramming tools that rely on Markdown code blocks, such as Mermaid.js and D2 by allowing you to exclude specific languages from Astroβs default syntax highlighting.
This option allows you to avoid rendering conflicts with tools that depend on the code not being highlighted without forcing you to disable syntax highlighting for other code blocks.
The following example configuration will exclude highlighting for
mermaidandmathcode blocks:import { defineConfig } from 'astro/config';export default defineConfig({markdown: {syntaxHighlight: {type: 'shiki',excludeLangs: ['mermaid', 'math'],},},});Read more about this new option in the Markdown syntax highlighting configuration docs.
-
π Patch Changes
- Updated dependencies [
042d1de]:- @astrojs/internal-helpers@0.6.1
- Updated dependencies [
πΏ Minor Changes
-
#13254
1e11f5eThanks @p0lyw0lf! - Adds remote image optimization in MarkdownPreviously, an internal remark plugin only looked for images in
![]()syntax that referred to a relative file path. This meant that only local images stored insrc/were passed through to an internal rehype plugin that would transform them for later processing by Astroβs image service.Now, the plugins recognize and transform both local and remote images using this syntax. Only authorized remote images specified in your config are transformed; remote images from other sources will not be processed.
While not configurable at this time, this process outputs two separate metadata fields (
localImagePathsandremoteImagePaths) which allow for the possibility of controlling the behavior of each type of image separately in the future.
π Patch Changes
- Updated dependencies [
1e11f5e]:- @astrojs/internal-helpers@0.6.0
-
πΏ Minor Changes
-
#12850
db252e0Thanks @colinbate! - Adds support for TOML frontmatter in.mdand.mdxfilesAstro 5.2 automatically identifies the format of your Markdown and MDX frontmatter based on the delimiter used. With
+++as a delimiter (instead of the---YAML code fence), your frontmatter will automatically be recognized and parsed as TOML.This is useful for adding existing content files with TOML frontmatter to your project from another framework such as Hugo.
TOML frontmatter can also be used with content collections, and files with different frontmatter languages can live together in the same project.
No configuration is required to use TOML frontmatter in your content files. Your delimiter will indicate your chosen frontmatter language:
+++date = 2025-01-30title = 'Use TOML frontmatter in Astro!'[author]name = 'Colin Bate'+++# Support for TOML frontmatter is here!
-
π Patch Changes
- #12361
3d89e62Thanks @LunaticMuch! - Upgrades theesbuildversion to matchvite
- #12361