Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions docs/astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import starlightGitHubAlerts from 'starlight-github-alerts';
import starlightBlog from 'starlight-blog';
import mermaid from 'astro-mermaid';
import { fileURLToPath } from 'node:url';
import { unified } from '@astrojs/markdown-remark';

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

unified is also the name of the popular unified npm package, so this import will confuse developers familiar with the remark/rehype ecosystem but not yet with Astro 7's new processor API.

💡 Suggested fix

Add a clarifying comment or alias to make the origin unmistakable:

// unified() is `@astrojs/markdown-remark`'s processor factory, not the unified npm package
import { unified } from '`@astrojs/markdown-remark`';

or use an alias:

import { unified as createMarkdownProcessor } from '`@astrojs/markdown-remark`';
// ...
processor: createMarkdownProcessor({ remarkPlugins: [...], rehypePlugins: [...] }),

This removes the guesswork about which unified this is and avoids a naming collision if the actual unified package is ever imported for a custom plugin.

import remarkStripEmojis from './src/lib/remark/stripEmojis.js';
import remarkTableDataLabels from './src/lib/remark/tableDataLabels.js';
import rehypeTableWrapper from './src/lib/rehype/tableWrapper.js';
Expand Down Expand Up @@ -37,8 +38,10 @@ export default defineConfig({
base: '/gh-aw/',
trailingSlash: 'always',
markdown: {
remarkPlugins: [remarkStripEmojis, remarkTableDataLabels],
rehypePlugins: [rehypeTableWrapper],
processor: unified({
remarkPlugins: [remarkStripEmojis, remarkTableDataLabels],
rehypePlugins: [rehypeTableWrapper],
}),
},
vite: {
server: {
Expand Down
Loading
Loading