summaryrefslogtreecommitdiff
path: root/packages/integrations/markdoc/src/tokenizer.ts
diff options
context:
space:
mode:
Diffstat (limited to 'packages/integrations/markdoc/src/tokenizer.ts')
-rw-r--r--packages/integrations/markdoc/src/tokenizer.ts6
1 files changed, 5 insertions, 1 deletions
diff --git a/packages/integrations/markdoc/src/tokenizer.ts b/packages/integrations/markdoc/src/tokenizer.ts
index 02719b363..79d0d7358 100644
--- a/packages/integrations/markdoc/src/tokenizer.ts
+++ b/packages/integrations/markdoc/src/tokenizer.ts
@@ -15,11 +15,15 @@ export function getMarkdocTokenizer(options: MarkdocIntegrationOptions | undefin
};
if (options?.allowHTML) {
- // we want to allow indentation for Markdoc tags that are interleaved inside HTML block elements
+ // allow indentation for Markdoc tags that are interleaved inside HTML block elements
tokenizerOptions.allowIndentation = true;
// enable HTML token detection in markdown-it
tokenizerOptions.html = true;
}
+ if (options?.ignoreIndentation) {
+ // allow indentation so nested Markdoc tags can be formatted for better readability
+ tokenizerOptions.allowIndentation = true;
+ }
_cachedMarkdocTokenizers[key] = new Markdoc.Tokenizer(tokenizerOptions);
}