summaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/src/index.ts
diff options
context:
space:
mode:
authorGravatar Ben Holmes <hey@bholmes.dev> 2023-05-24 16:52:22 -0400
committerGravatar GitHub <noreply@github.com> 2023-05-24 16:52:22 -0400
commit1efaef6be0265c68eac706623778e8ad23b33247 (patch)
tree3002f8ee7580157b7cb7df7e8741aa1c0b03448b /packages/integrations/markdoc/src/index.ts
parent7851f9258fae2f54795470253df9ce4bcd5f9cb0 (diff)
downloadastro-1efaef6be0265c68eac706623778e8ad23b33247.tar.gz
astro-1efaef6be0265c68eac706623778e8ad23b33247.tar.zst
astro-1efaef6be0265c68eac706623778e8ad23b33247.zip
Markdoc - Shiki (#7187)
* chore: remove unused util * chore: changeset * deps: shiki * wip: first stab at shiki markdoc config * feat: get shiki working! * refactor: return HTML string directly from transform * chore: move shiki to markdoc dev dep * refactor: use async cache with clear docs on why * test: transform units with Shiki config options * refactor: switch to `extends` model * refactor: nodes/ -> extensions/ * feat: raise friendly error for Promise extensions * docs: README * chore: lint * chore: dead file * chore: lowercase for fuzzy find please * fix: bad ctx spread * chore: clean up cache, add shiki imp error * chore: add shiki to optional peer deps * chore: hoist those consts * docs: more explicit "install shiki now please" Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca> * oops bad find and replace * chore: update changeset * nit: period haunts me --------- Co-authored-by: Sarah Rainsberger <sarah@rainsberger.ca>
Diffstat (limited to 'packages/integrations/markdoc/src/index.ts')
-rw-r--r--packages/integrations/markdoc/src/index.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/integrations/markdoc/src/index.ts b/packages/integrations/markdoc/src/index.ts
index 627f08c77..64ae4cbc0 100644
--- a/packages/integrations/markdoc/src/index.ts
+++ b/packages/integrations/markdoc/src/index.ts
@@ -52,7 +52,11 @@ export default function markdocIntegration(legacyConfig?: any): AstroIntegration
async getRenderModule({ entry, viteId }) {
const ast = Markdoc.parse(entry.body);
const pluginContext = this;
- const markdocConfig = setupConfig(userMarkdocConfig, entry);
+ const markdocConfig = setupConfig(
+ userMarkdocConfig,
+ entry,
+ markdocConfigResult?.fileUrl.pathname
+ );
const validationErrors = Markdoc.validate(ast, markdocConfig).filter((e) => {
return (