diff --git a/example/example-i18n.html b/example/example-i18n.html
index f765f1e9..1c40d370 100644
--- a/example/example-i18n.html
+++ b/example/example-i18n.html
@@ -50,7 +50,6 @@
-
@@ -112,11 +111,6 @@
shortcut: 'CMD+SHIFT+L'
},
- checklist: {
- class: Checklist,
- inlineToolbar: true,
- },
-
quote: {
class: Quote,
inlineToolbar: true,
@@ -202,7 +196,7 @@
/**
* Translation of "Convert To" at the Block Tunes Popover
*/
- "Convert to": "Конвертировать в"
+ "Convert to": "Конвертировать в",
}
},
@@ -212,7 +206,8 @@
"toolNames": {
"Text": "Параграф",
"Heading": "Заголовок",
- "List": "Список",
+ "Ordered List": "Нумерованный список",
+ "Unordered List": "Маркированный список",
"Warning": "Примечание",
"Checklist": "Чеклист",
"Quote": "Цитата",
@@ -270,7 +265,12 @@
"Wrong response format from the server": "Неполадки на сервере",
},
"header": {
- "Header": "Заголовок",
+ "Heading 1": "Заголовок 1",
+ "Heading 2": "Заголовок 2",
+ "Heading 3": "Заголовок 3",
+ "Heading 4": "Заголовок 4",
+ "Heading 5": "Заголовок 5",
+ "Heading 6": "Заголовок 6",
},
"paragraph": {
"Enter something": "Введите текст"
@@ -278,6 +278,7 @@
"list": {
"Ordered": "Нумерованный",
"Unordered": "Маркированный",
+ "Checklist": "Чеклист",
},
/**
* Translation of "Convert To" at the Inline Toolbar hint
@@ -298,7 +299,8 @@
* Also, there are few internal block tunes: "delete", "moveUp" and "moveDown"
*/
"delete": {
- "Delete": "Удалить"
+ "Delete": "Удалить",
+ "Click to delete": "Подтвердить удаление"
},
"moveUp": {
"Move up": "Переместить вверх"
diff --git a/example/example-rtl.html b/example/example-rtl.html
index 1a347316..548c4f4e 100644
--- a/example/example-rtl.html
+++ b/example/example-rtl.html
@@ -120,12 +120,6 @@
inlineToolbar: ['link'],
},
- list: {
- class: List,
- inlineToolbar: true,
- shortcut: 'CMD+SHIFT+L'
- },
-
checklist: {
class: Checklist,
inlineToolbar: true,
diff --git a/src/components/dom.ts b/src/components/dom.ts
index 67573555..0cbfbeda 100644
--- a/src/components/dom.ts
+++ b/src/components/dom.ts
@@ -623,6 +623,9 @@ export default class Dom {
/**
* If no node found or last node is empty, return null
+ * - The root node has no text nodes at all
+ * - The TreeWalker couldn't find any text nodes in the DOM tree
+ * - The root node itself is null or invalid
*/
if (!lastTextNode) {
return {
@@ -633,6 +636,14 @@ export default class Dom {
const textContent = lastTextNode.textContent;
+ /**
+ * - The text node exists but has no content (textContent is null)
+ * - The text node exists but has empty content (textContent.length === 0)
+ * This could be due to:
+ * - Empty text nodes ()
+ * - Nodes with only whitespace
+ * - Nodes that were cleared but not removed
+ */
if (textContent === null || textContent.length === 0) {
return {
node: null,