Skip to content

Commit cc624ca

Browse files
committed
i18n and rtl examples updated
1 parent 9f942ca commit cc624ca

File tree

3 files changed

+23
-16
lines changed

3 files changed

+23
-16
lines changed

example/example-i18n.html

Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
<script src="https://cdn.jsdelivr.net/npm/@editorjs/image@latest"></script><!-- Image -->
5151
<script src="https://cdn.jsdelivr.net/npm/@editorjs/delimiter@latest"></script><!-- Delimiter -->
5252
<script src="https://cdn.jsdelivr.net/npm/@editorjs/list@latest"></script><!-- List -->
53-
<script src="https://cdn.jsdelivr.net/npm/@editorjs/checklist@latest"></script><!-- Checklist -->
5453
<script src="https://cdn.jsdelivr.net/npm/@editorjs/quote@latest"></script><!-- Quote -->
5554
<script src="https://cdn.jsdelivr.net/npm/@editorjs/code@latest"></script><!-- Code -->
5655
<script src="https://cdn.jsdelivr.net/npm/@editorjs/embed@latest"></script><!-- Embed -->
@@ -112,11 +111,6 @@
112111
shortcut: 'CMD+SHIFT+L'
113112
},
114113

115-
checklist: {
116-
class: Checklist,
117-
inlineToolbar: true,
118-
},
119-
120114
quote: {
121115
class: Quote,
122116
inlineToolbar: true,
@@ -202,7 +196,7 @@
202196
/**
203197
* Translation of "Convert To" at the Block Tunes Popover
204198
*/
205-
"Convert to": "Конвертировать в"
199+
"Convert to": "Конвертировать в",
206200
}
207201
},
208202

@@ -212,7 +206,8 @@
212206
"toolNames": {
213207
"Text": "Параграф",
214208
"Heading": "Заголовок",
215-
"List": "Список",
209+
"Ordered List": "Нумерованный список",
210+
"Unordered List": "Маркированный список",
216211
"Warning": "Примечание",
217212
"Checklist": "Чеклист",
218213
"Quote": "Цитата",
@@ -270,14 +265,20 @@
270265
"Wrong response format from the server": "Неполадки на сервере",
271266
},
272267
"header": {
273-
"Header": "Заголовок",
268+
"Heading 1": "Заголовок 1",
269+
"Heading 2": "Заголовок 2",
270+
"Heading 3": "Заголовок 3",
271+
"Heading 4": "Заголовок 4",
272+
"Heading 5": "Заголовок 5",
273+
"Heading 6": "Заголовок 6",
274274
},
275275
"paragraph": {
276276
"Enter something": "Введите текст"
277277
},
278278
"list": {
279279
"Ordered": "Нумерованный",
280280
"Unordered": "Маркированный",
281+
"Checklist": "Чеклист",
281282
},
282283
/**
283284
* Translation of "Convert To" at the Inline Toolbar hint
@@ -298,7 +299,8 @@
298299
* Also, there are few internal block tunes: "delete", "moveUp" and "moveDown"
299300
*/
300301
"delete": {
301-
"Delete": "Удалить"
302+
"Delete": "Удалить",
303+
"Click to delete": "Подтвердить удаление"
302304
},
303305
"moveUp": {
304306
"Move up": "Переместить вверх"

example/example-rtl.html

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,6 @@
120120
inlineToolbar: ['link'],
121121
},
122122

123-
list: {
124-
class: List,
125-
inlineToolbar: true,
126-
shortcut: 'CMD+SHIFT+L'
127-
},
128-
129123
checklist: {
130124
class: Checklist,
131125
inlineToolbar: true,

src/components/dom.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,9 @@ export default class Dom {
623623

624624
/**
625625
* If no node found or last node is empty, return null
626+
* - The root node has no text nodes at all
627+
* - The TreeWalker couldn't find any text nodes in the DOM tree
628+
* - The root node itself is null or invalid
626629
*/
627630
if (!lastTextNode) {
628631
return {
@@ -633,6 +636,14 @@ export default class Dom {
633636

634637
const textContent = lastTextNode.textContent;
635638

639+
/**
640+
* - The text node exists but has no content (textContent is null)
641+
* - The text node exists but has empty content (textContent.length === 0)
642+
* This could be due to:
643+
* - Empty text nodes (<span></span>)
644+
* - Nodes with only whitespace
645+
* - Nodes that were cleared but not removed
646+
*/
636647
if (textContent === null || textContent.length === 0) {
637648
return {
638649
node: null,

0 commit comments

Comments
 (0)