aboutsummaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/src/tokenizer.ts
diff options
context:
space:
mode:
authorGravatar Peter Schilling <peter@schpet.com> 2024-07-17 05:14:35 -0700
committerGravatar GitHub <noreply@github.com> 2024-07-17 14:14:35 +0200
commiteb303e1ad5dade7787c0d9bbb520c21292cf3950 (patch)
tree731a9f9876f555b920c5f9f0ca88d26e92f73fd3 /packages/integrations/markdoc/src/tokenizer.ts
parent3b94324228b5b587cadf766a8e112dec3f33642b (diff)
downloadastro-eb303e1ad5dade7787c0d9bbb520c21292cf3950.tar.gz
astro-eb303e1ad5dade7787c0d9bbb520c21292cf3950.tar.zst
astro-eb303e1ad5dade7787c0d9bbb520c21292cf3950.zip
feat(markdoc): Support markdown-it's typographer option (#11450)
* Support markdoc-it's typographer option in markdoc * Update .changeset/forty-scissors-jog.md [skip ci] * Update .changeset/forty-scissors-jog.md [skip ci] * Fix typo in changeset --------- Co-authored-by: Bjorn Lu <bjornlu.dev@gmail.com> Co-authored-by: Erika <3019731+Princesseuh@users.noreply.github.com>
Diffstat (limited to 'packages/integrations/markdoc/src/tokenizer.ts')
-rw-r--r--packages/integrations/markdoc/src/tokenizer.ts5
1 files changed, 5 insertions, 0 deletions
diff --git a/packages/integrations/markdoc/src/tokenizer.ts b/packages/integrations/markdoc/src/tokenizer.ts
index 79d0d7358..001e6da06 100644
--- a/packages/integrations/markdoc/src/tokenizer.ts
+++ b/packages/integrations/markdoc/src/tokenizer.ts
@@ -24,6 +24,11 @@ export function getMarkdocTokenizer(options: MarkdocIntegrationOptions | undefin
// allow indentation so nested Markdoc tags can be formatted for better readability
tokenizerOptions.allowIndentation = true;
}
+ if (options?.typographer) {
+ // enable typographer to convert straight quotes to curly quotes, etc.
+ tokenizerOptions.typographer = options.typographer;
+ }
+
_cachedMarkdocTokenizers[key] = new Markdoc.Tokenizer(tokenizerOptions);
}