From 73b8d60f8c3eeae74035202b0ea0d4848e736c7d Mon Sep 17 00:00:00 2001 From: AndyClifford <70119888+AndyClifford@users.noreply.github.com> Date: Tue, 24 Oct 2023 20:40:54 +1300 Subject: [PATCH] feat(markdoc): allowIndentation integration option (#8802) --- .changeset/hip-rockets-glow.md | 5 +++ packages/integrations/markdoc/README.md | 34 +++++++++++++++ packages/integrations/markdoc/src/options.ts | 1 + .../integrations/markdoc/src/tokenizer.ts | 6 ++- .../astro.config.mjs | 7 ++++ .../markdoc.config.ts | 26 ++++++++++++ .../package.json | 9 ++++ .../src/components/Code.astro | 12 ++++++ .../src/components/CustomMarquee.astro | 1 + .../blog/with-indented-components.mdoc | 24 +++++++++++ .../src/pages/index.astro | 19 +++++++++ .../integrations/markdoc/test/render.test.js | 42 +++++++++++++++++++ pnpm-lock.yaml | 9 ++++ 13 files changed, 194 insertions(+), 1 deletion(-) create mode 100644 .changeset/hip-rockets-glow.md create mode 100644 packages/integrations/markdoc/test/fixtures/render-with-indented-components/astro.config.mjs create mode 100644 packages/integrations/markdoc/test/fixtures/render-with-indented-components/markdoc.config.ts create mode 100644 packages/integrations/markdoc/test/fixtures/render-with-indented-components/package.json create mode 100644 packages/integrations/markdoc/test/fixtures/render-with-indented-components/src/components/Code.astro create mode 100644 packages/integrations/markdoc/test/fixtures/render-with-indented-components/src/components/CustomMarquee.astro create mode 100644 packages/integrations/markdoc/test/fixtures/render-with-indented-components/src/content/blog/with-indented-components.mdoc create mode 100644 packages/integrations/markdoc/test/fixtures/render-with-indented-components/src/pages/index.astro diff --git a/.changeset/hip-rockets-glow.md b/.changeset/hip-rockets-glow.md new file mode 100644 index 000000000000..fd121c0d4022 --- /dev/null +++ b/.changeset/hip-rockets-glow.md @@ -0,0 +1,5 @@ +--- +'@astrojs/markdoc': minor +--- + +Added ignoreIndentation as a markdoc integration option to enable better readability of source code. diff --git a/packages/integrations/markdoc/README.md b/packages/integrations/markdoc/README.md index da575acc226f..fa506b24add1 100644 --- a/packages/integrations/markdoc/README.md +++ b/packages/integrations/markdoc/README.md @@ -458,6 +458,40 @@ To achieve a more Markdown-like experience, where HTML elements can be included > **Warning** > When `allowHTML` is enabled, HTML markup inside Markdoc documents will be rendered as actual HTML elements (including `