From 45403ac951d8439739788cec31ff1950ad045fa8 Mon Sep 17 00:00:00 2001 From: Abhay V Ashokan <35297280+AbhayVAshokan@users.noreply.github.com> Date: Wed, 20 Nov 2024 16:33:35 +0530 Subject: [PATCH] fix: documentation for `defaultLanguage` setting in the `CodeBlock` extension (#54) --- .changeset/modern-ladybugs-crash.md | 5 +++++ src/content/editor/extensions/nodes/code-block.mdx | 12 ++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 .changeset/modern-ladybugs-crash.md diff --git a/.changeset/modern-ladybugs-crash.md b/.changeset/modern-ladybugs-crash.md new file mode 100644 index 0000000..4b8e015 --- /dev/null +++ b/.changeset/modern-ladybugs-crash.md @@ -0,0 +1,5 @@ +--- +'tiptap-docs': patch +--- + +Added documentation for `defaultLanguage` setting in the `CodeBlock` extension. diff --git a/src/content/editor/extensions/nodes/code-block.mdx b/src/content/editor/extensions/nodes/code-block.mdx index 430273d..3034404 100644 --- a/src/content/editor/extensions/nodes/code-block.mdx +++ b/src/content/editor/extensions/nodes/code-block.mdx @@ -68,6 +68,18 @@ CodeBlock.configure({ }) ``` +### defaultLanguage + +Define a default language instead of the automatic detection of lowlight. + +Default: `null` + +```js +CodeBlock.configure({ + defaultLanguage: 'plaintext', +}) +``` + ### exitOnArrowDown Define whether the node should be exited on arrow down if there is no node after it.