| 1 |
/** |
| 2 |
* Starlight plugin that wraps the remark-strip-md-extension plugin. |
| 3 |
* |
| 4 |
* This wrapper is needed because Starlight overrides the markdown.remarkPlugins |
| 5 |
* configuration. By using a Starlight plugin, we ensure our remark plugin is |
| 6 |
* properly integrated into Starlight's markdown processing pipeline. |
| 7 |
*/ |
| 8 |
|
| 9 |
import remarkStripMdExtension from './remark-strip-md-extension.mjs'; |
| 10 |
|
| 11 |
export default function starlightStripMdExtension() { |
| 12 |
return { |
| 13 |
name: 'starlight-strip-md-extension', |
| 14 |
hooks: { |
| 15 |
'config:setup'({ addIntegration }) { |
| 16 |
addIntegration({ |
| 17 |
name: 'starlight-strip-md-extension-integration', |
| 18 |
hooks: { |
| 19 |
'astro:config:setup'({ updateConfig }) { |
| 20 |
updateConfig({ |
| 21 |
markdown: { |
| 22 |
remarkPlugins: [remarkStripMdExtension], |
| 23 |
}, |
| 24 |
}); |
| 25 |
}, |
| 26 |
}, |
| 27 |
}); |
| 28 |
}, |
| 29 |
}, |
| 30 |
}; |
| 31 |
} |