diff --git a/examples/03-ui-components/21-block-language/.bnexample.json b/examples/03-ui-components/21-block-language/.bnexample.json new file mode 100644 index 0000000000..36f0b7cd0a --- /dev/null +++ b/examples/03-ui-components/21-block-language/.bnexample.json @@ -0,0 +1,8 @@ +{ + "playground": true, + "docs": true, + "author": "", + "tags": ["Intermediate", "Blocks", "UI Components", "Block Side Menu"], + "dependencies": {}, + "pro": false +} diff --git a/examples/03-ui-components/21-block-language/README.md b/examples/03-ui-components/21-block-language/README.md new file mode 100644 index 0000000000..dfed404c5d --- /dev/null +++ b/examples/03-ui-components/21-block-language/README.md @@ -0,0 +1,9 @@ +# Block languages + +This example adds an optional language submenu to the drag handle menu, with English, French, and German. Each block can declare its language for assistive technology or inherit the surrounding language. + +**Try it out:** Open a block's drag handle menu and choose a language. + +## Relevant Docs + +- [Changing the Drag Handle Menu](https://www.blocknotejs.org/docs/react/components/side-menu) diff --git a/examples/03-ui-components/21-block-language/index.html b/examples/03-ui-components/21-block-language/index.html new file mode 100644 index 0000000000..8fda0fb9f6 --- /dev/null +++ b/examples/03-ui-components/21-block-language/index.html @@ -0,0 +1,17 @@ + +
+ + +Unknown language
+Bonjour
+Hello
+No language
+Unknown language
\ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/html/language/explicit.html b/tests/src/unit/core/formatConversion/export/__snapshots__/html/language/explicit.html new file mode 100644 index 0000000000..d59eccf213 --- /dev/null +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/html/language/explicit.html @@ -0,0 +1 @@ +Bonjour
\ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/html/language/regional.html b/tests/src/unit/core/formatConversion/export/__snapshots__/html/language/regional.html new file mode 100644 index 0000000000..7603f00396 --- /dev/null +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/html/language/regional.html @@ -0,0 +1 @@ +Hello
\ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/html/language/undefined.html b/tests/src/unit/core/formatConversion/export/__snapshots__/html/language/undefined.html new file mode 100644 index 0000000000..1180a68f9f --- /dev/null +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/html/language/undefined.html @@ -0,0 +1 @@ +No language
\ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/empty.md b/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/empty.md new file mode 100644 index 0000000000..87a0873bad --- /dev/null +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/empty.md @@ -0,0 +1 @@ +Unknown language diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/explicit.md b/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/explicit.md new file mode 100644 index 0000000000..632e4fe73c --- /dev/null +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/explicit.md @@ -0,0 +1 @@ +Bonjour diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/regional.md b/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/regional.md new file mode 100644 index 0000000000..e965047ad7 --- /dev/null +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/regional.md @@ -0,0 +1 @@ +Hello diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/undefined.md b/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/undefined.md new file mode 100644 index 0000000000..4e5b2aaed0 --- /dev/null +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/markdown/language/undefined.md @@ -0,0 +1 @@ +No language diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/complex/document.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/complex/document.json index 0eb89bbcda..8614b013ec 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/complex/document.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/complex/document.json @@ -8,6 +8,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": false, + "lang": undefined, "level": 1, "textAlignment": "left", "textColor": "default", @@ -31,6 +32,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -54,6 +56,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": false, + "lang": undefined, "level": 2, "textAlignment": "left", "textColor": "default", @@ -77,6 +80,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -128,6 +132,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -150,6 +155,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -183,6 +189,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textColor": "default", }, "content": [ diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/complex/misc.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/complex/misc.json index 5689b6b144..4fe7e10d5f 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/complex/misc.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/complex/misc.json @@ -8,6 +8,7 @@ "attrs": { "backgroundColor": "blue", "isToggleable": false, + "lang": undefined, "level": 2, "textAlignment": "right", "textColor": "yellow", @@ -50,6 +51,7 @@ { "attrs": { "backgroundColor": "red", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -72,6 +74,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/custom-blocks/simpleCustomParagraph.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/custom-blocks/simpleCustomParagraph.json index c63e9fad19..2df9c26cdf 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/custom-blocks/simpleCustomParagraph.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/custom-blocks/simpleCustomParagraph.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/basic.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/basic.json index 9f61632bab..0c4e600dd4 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/basic.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/basic.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/between-links.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/between-links.json index 9db2d101f6..10c52f5ed6 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/between-links.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/between-links.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/end.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/end.json index 8ac49d80e1..59b81cd41d 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/end.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/end.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/link.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/link.json index 7a3369fd10..af5d2fa33f 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/link.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/link.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/multiple.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/multiple.json index 2f47b4bc9b..116923be63 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/multiple.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/multiple.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/only.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/only.json index 08f5ee78ee..e1af37de70 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/only.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/only.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/start.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/start.json index 72eb111324..f4b0bfb7f2 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/start.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/start.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/styles.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/styles.json index f7f3c35ae8..c6394b3acb 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/styles.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/hardbreak/styles.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h1.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h1.json index d147b23ade..22c1ada3d4 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h1.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h1.json @@ -8,6 +8,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": false, + "lang": undefined, "level": 1, "textAlignment": "left", "textColor": "default", diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h2.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h2.json index f9f92e7081..84782b9300 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h2.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h2.json @@ -8,6 +8,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": false, + "lang": undefined, "level": 2, "textAlignment": "left", "textColor": "default", diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h3.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h3.json index 6399a58563..c02d33f968 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h3.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h3.json @@ -8,6 +8,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": false, + "lang": undefined, "level": 3, "textAlignment": "left", "textColor": "default", diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h4.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h4.json index c23a0c4809..9953d835b1 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h4.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h4.json @@ -8,6 +8,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": false, + "lang": undefined, "level": 4, "textAlignment": "left", "textColor": "default", diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h5.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h5.json index 0867b7796f..4aeda8b9e2 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h5.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h5.json @@ -8,6 +8,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": false, + "lang": undefined, "level": 5, "textAlignment": "left", "textColor": "default", diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h6.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h6.json index b5eddefddc..fe81e66a3e 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h6.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/h6.json @@ -8,6 +8,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": false, + "lang": undefined, "level": 6, "textAlignment": "left", "textColor": "default", diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/styled.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/styled.json index ff107bc15f..1536f8848e 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/styled.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/styled.json @@ -8,6 +8,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": false, + "lang": undefined, "level": 1, "textAlignment": "left", "textColor": "default", diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/toggleable.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/toggleable.json index 7bb4c57f86..9990fe0775 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/toggleable.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/heading/toggleable.json @@ -8,6 +8,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": true, + "lang": undefined, "level": 2, "textAlignment": "left", "textColor": "default", @@ -30,6 +31,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/inlineContent/mentionWithToExternalHTML.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/inlineContent/mentionWithToExternalHTML.json index b006f6ec56..5d0a87f376 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/inlineContent/mentionWithToExternalHTML.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/inlineContent/mentionWithToExternalHTML.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/inlineContent/tagWithoutToExternalHTML.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/inlineContent/tagWithoutToExternalHTML.json index 9072d90228..449a54ae9c 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/inlineContent/tagWithoutToExternalHTML.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/inlineContent/tagWithoutToExternalHTML.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/empty.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/empty.json new file mode 100644 index 0000000000..fbb0198803 --- /dev/null +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/empty.json @@ -0,0 +1,25 @@ +[ + { + "attrs": { + "id": "1", + }, + "content": [ + { + "attrs": { + "backgroundColor": "default", + "lang": "", + "textAlignment": "left", + "textColor": "default", + }, + "content": [ + { + "text": "Unknown language", + "type": "text", + }, + ], + "type": "paragraph", + }, + ], + "type": "blockContainer", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/explicit.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/explicit.json new file mode 100644 index 0000000000..9484465750 --- /dev/null +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/explicit.json @@ -0,0 +1,25 @@ +[ + { + "attrs": { + "id": "1", + }, + "content": [ + { + "attrs": { + "backgroundColor": "default", + "lang": "fr", + "textAlignment": "left", + "textColor": "default", + }, + "content": [ + { + "text": "Bonjour", + "type": "text", + }, + ], + "type": "paragraph", + }, + ], + "type": "blockContainer", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/regional.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/regional.json new file mode 100644 index 0000000000..8e4c4837ef --- /dev/null +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/regional.json @@ -0,0 +1,25 @@ +[ + { + "attrs": { + "id": "1", + }, + "content": [ + { + "attrs": { + "backgroundColor": "default", + "lang": "en-GB", + "textAlignment": "left", + "textColor": "default", + }, + "content": [ + { + "text": "Hello", + "type": "text", + }, + ], + "type": "paragraph", + }, + ], + "type": "blockContainer", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/undefined.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/undefined.json new file mode 100644 index 0000000000..9d8581600f --- /dev/null +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/language/undefined.json @@ -0,0 +1,25 @@ +[ + { + "attrs": { + "id": "1", + }, + "content": [ + { + "attrs": { + "backgroundColor": "default", + "lang": undefined, + "textAlignment": "left", + "textColor": "default", + }, + "content": [ + { + "text": "No language", + "type": "text", + }, + ], + "type": "paragraph", + }, + ], + "type": "blockContainer", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/basic.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/basic.json index cd4b7fa368..a61290bae8 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/basic.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/basic.json @@ -13,6 +13,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/emptyChildren.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/emptyChildren.json index 7b02725a5d..f4f9385da8 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/emptyChildren.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/emptyChildren.json @@ -13,6 +13,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/nested.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/nested.json index 4a45ff2fa9..a51ee037e5 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/nested.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/layoutBlock/nested.json @@ -14,6 +14,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": false, + "lang": undefined, "level": 1, "textAlignment": "left", "textColor": "default", @@ -43,6 +44,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/adjacent.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/adjacent.json index f3020cdf7f..d779b4d1a3 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/adjacent.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/adjacent.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/basic.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/basic.json index b85306efc8..c17d2b276c 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/basic.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/basic.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/plainUrl.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/plainUrl.json index dc5aa26397..d50fc0c9a2 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/plainUrl.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/plainUrl.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/styled.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/styled.json index 2c01e6c1a1..29472c39b9 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/styled.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/styled.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/urlWithParens.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/urlWithParens.json index 4de7926c89..605fba2416 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/urlWithParens.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/urlWithParens.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/withCode.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/withCode.json index bf1f1da31f..a48339463e 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/withCode.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/link/withCode.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/basic.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/basic.json index 7a7d1b00e1..3781b7b8bc 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/basic.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/basic.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -29,6 +30,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -51,6 +53,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "start": undefined, "textAlignment": "left", "textColor": "default", @@ -74,6 +77,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "start": undefined, "textAlignment": "left", "textColor": "default", @@ -98,6 +102,7 @@ "attrs": { "backgroundColor": "default", "checked": false, + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -121,6 +126,7 @@ "attrs": { "backgroundColor": "default", "checked": true, + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -143,6 +149,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/nested.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/nested.json index d51adf974b..f2284954fe 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/nested.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/nested.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -29,6 +30,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -50,6 +52,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "start": undefined, "textAlignment": "left", "textColor": "default", @@ -73,6 +76,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "start": undefined, "textAlignment": "left", "textColor": "default", @@ -96,6 +100,7 @@ "attrs": { "backgroundColor": "default", "checked": false, + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -119,6 +124,7 @@ "attrs": { "backgroundColor": "default", "checked": true, + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -140,6 +146,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/numberedListStart.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/numberedListStart.json index 387b4fa073..6e07fe7387 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/numberedListStart.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/numberedListStart.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "start": 5, "textAlignment": "left", "textColor": "default", @@ -30,6 +31,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "start": undefined, "textAlignment": "left", "textColor": "default", diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/toggleWithChildren.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/toggleWithChildren.json index 9b7407a060..0b7acd7ec6 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/toggleWithChildren.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/lists/toggleWithChildren.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -28,6 +29,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -50,6 +52,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -79,6 +82,7 @@ "attrs": { "backgroundColor": "default", "isToggleable": true, + "lang": undefined, "level": 2, "textAlignment": "left", "textColor": "default", @@ -101,6 +105,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/malformed/JSON.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/malformed/JSON.json index b70720d495..d49b33bb27 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/malformed/JSON.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/malformed/JSON.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/basic.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/basic.json index d32dcc601e..dc8c747a58 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/basic.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/basic.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/empty.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/empty.json index 8fdcafd2e5..0d65b3ea2d 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/empty.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/empty.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/emptyBetween.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/emptyBetween.json index 5807d53144..bca737e39c 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/emptyBetween.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/emptyBetween.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -29,6 +30,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -45,6 +47,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/lineBreaks.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/lineBreaks.json index fda9b14014..3fc3316084 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/lineBreaks.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/lineBreaks.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/multiple.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/multiple.json index affba0772c..e8022ccba5 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/multiple.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/multiple.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -29,6 +30,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -51,6 +53,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/nested.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/nested.json index 363e14eec7..6441b2ba18 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/nested.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/nested.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -28,6 +29,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -50,6 +52,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/styled.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/styled.json index 282b3bb4d5..f956200349 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/styled.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/paragraph/styled.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "pink", + "lang": undefined, "textAlignment": "center", "textColor": "orange", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/basic.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/basic.json index 9234a8f05f..4562f81db1 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/basic.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/basic.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textColor": "default", }, "content": [ diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/multiple.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/multiple.json index 458e24879a..dfecd20faa 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/multiple.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/multiple.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textColor": "default", }, "content": [ @@ -28,6 +29,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textColor": "default", }, "content": [ diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/nested.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/nested.json index b3c46ed220..267442210e 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/nested.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/nested.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textColor": "default", }, "content": [ @@ -27,6 +28,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/styled.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/styled.json index a482c2ad58..00b3a1d333 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/styled.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/styled.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textColor": "default", }, "content": [ diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/withLink.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/withLink.json index c0e2857679..cbdc340e9e 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/withLink.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/quote/withLink.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textColor": "default", }, "content": [ diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/backgroundColor.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/backgroundColor.json index e07954b219..c661968354 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/backgroundColor.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/backgroundColor.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/bold.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/bold.json index b6d5b7a208..e1936839cc 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/bold.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/bold.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/boldItalicStrike.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/boldItalicStrike.json index 7c5f05d763..8465be836e 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/boldItalicStrike.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/boldItalicStrike.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/code.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/code.json index 2cf0463e03..710cbaf255 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/code.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/code.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/combined.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/combined.json index 5b91fb8abb..8b420bb57d 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/combined.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/combined.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/italic.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/italic.json index 7d22809e81..f7d32b0ad9 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/italic.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/italic.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/mixedInParagraph.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/mixedInParagraph.json index d72aa1d3bb..0805a95e64 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/mixedInParagraph.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/mixedInParagraph.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/strike.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/strike.json index 756569ade9..1a41b3fe54 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/strike.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/strike.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/textColor.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/textColor.json index 7bca812fd7..1e3f80bf3a 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/textColor.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/textColor.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/underline.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/underline.json index 348c2ae742..242020e918 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/underline.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/style/underline.json @@ -7,6 +7,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/titledBlock/basic.json b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/titledBlock/basic.json index 44e5e45d26..e96c62d066 100644 --- a/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/titledBlock/basic.json +++ b/tests/src/unit/core/formatConversion/export/__snapshots__/nodes/titledBlock/basic.json @@ -23,6 +23,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, @@ -45,6 +46,7 @@ { "attrs": { "backgroundColor": "default", + "lang": undefined, "textAlignment": "left", "textColor": "default", }, diff --git a/tests/src/unit/core/formatConversion/export/exportTestInstances.ts b/tests/src/unit/core/formatConversion/export/exportTestInstances.ts index a3e5600295..49abb4341d 100644 --- a/tests/src/unit/core/formatConversion/export/exportTestInstances.ts +++ b/tests/src/unit/core/formatConversion/export/exportTestInstances.ts @@ -18,6 +18,46 @@ export const exportTestInstancesBlockNoteHTML: TestInstance< TestInlineContentSchema, TestStyleSchema >[] = [ + { + testCase: { + name: "language/explicit", + content: [ + { type: "paragraph", props: { lang: "fr" }, content: "Bonjour" }, + ], + }, + executeTest: testExportBlockNoteHTML, + }, + { + testCase: { + name: "language/regional", + content: [ + { type: "paragraph", props: { lang: "en-GB" }, content: "Hello" }, + ], + }, + executeTest: testExportBlockNoteHTML, + }, + { + testCase: { + name: "language/undefined", + content: [ + { + type: "paragraph", + props: { lang: undefined }, + content: "No language", + }, + ], + }, + executeTest: testExportBlockNoteHTML, + }, + { + testCase: { + name: "language/empty", + content: [ + { type: "paragraph", props: { lang: "" }, content: "Unknown language" }, + ], + }, + executeTest: testExportBlockNoteHTML, + }, { testCase: { name: "paragraph/empty", diff --git a/tests/src/unit/core/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts b/tests/src/unit/core/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts index f3dfa02604..15a3fba988 100644 --- a/tests/src/unit/core/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts +++ b/tests/src/unit/core/formatConversion/exportParseEquality/exportParseEqualityTestInstances.ts @@ -36,6 +36,12 @@ export const exportParseEqualityTestInstancesHTML: TestInstance< TestInlineContentSchema, TestStyleSchema >[] = [ + ...exportTestInstancesBlockNoteHTML + .filter(({ testCase }) => testCase.name.startsWith("language/")) + .map(({ testCase }) => ({ + testCase, + executeTest: testExportParseEqualityHTML, + })), { testCase: { name: "schema/blocks", diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/data-attribute.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/data-attribute.json new file mode 100644 index 0000000000..e43198b7cf --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/data-attribute.json @@ -0,0 +1,20 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bonjour", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "lang": "fr", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/empty.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/empty.json new file mode 100644 index 0000000000..e5fdc01909 --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/empty.json @@ -0,0 +1,20 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Unknown language", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "lang": "", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/explicit.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/explicit.json new file mode 100644 index 0000000000..e43198b7cf --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/explicit.json @@ -0,0 +1,20 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Bonjour", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "lang": "fr", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/regional.json b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/regional.json new file mode 100644 index 0000000000..c8ca2e4d1b --- /dev/null +++ b/tests/src/unit/core/formatConversion/parse/__snapshots__/html/language/regional.json @@ -0,0 +1,20 @@ +[ + { + "children": [], + "content": [ + { + "styles": {}, + "text": "Hello", + "type": "text", + }, + ], + "id": "1", + "props": { + "backgroundColor": "default", + "lang": "en-GB", + "textAlignment": "left", + "textColor": "default", + }, + "type": "paragraph", + }, +] \ No newline at end of file diff --git a/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts b/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts index 33b00531c5..8b7a26fed3 100644 --- a/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts +++ b/tests/src/unit/core/formatConversion/parse/parseTestInstances.ts @@ -16,6 +16,34 @@ export const parseTestInstancesHTML: TestInstance< TestInlineContentSchema, TestStyleSchema >[] = [ + { + testCase: { + name: "language/explicit", + content: 'Bonjour
', + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "language/regional", + content: 'Hello
', + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "language/empty", + content: 'Unknown language
', + }, + executeTest: testParseHTML, + }, + { + testCase: { + name: "language/data-attribute", + content: 'Bonjour
', + }, + executeTest: testParseHTML, + }, { testCase: { name: "basicBlockTypes",