edwh-editorjs 2.6.0__py3-none-any.whl → 2.6.1__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
editorjs/__about__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "2.6.
|
|
1
|
+
__version__ = "2.6.1"
|
editorjs/blocks.py
CHANGED
|
@@ -187,6 +187,18 @@ class ParagraphBlock(EditorJSBlock):
|
|
|
187
187
|
|
|
188
188
|
return f"{text}\n\n"
|
|
189
189
|
|
|
190
|
+
@staticmethod
|
|
191
|
+
def _find_closing_editorjs_tag(nodes: list, start_idx: int) -> int | None:
|
|
192
|
+
"""Find index of closing </editorjs> tag."""
|
|
193
|
+
for idx, node in enumerate(nodes[start_idx:], start=start_idx):
|
|
194
|
+
if (
|
|
195
|
+
node.get("type") == "html"
|
|
196
|
+
and node.get("value", "").strip() == "</editorjs>"
|
|
197
|
+
):
|
|
198
|
+
return idx
|
|
199
|
+
|
|
200
|
+
return None
|
|
201
|
+
|
|
190
202
|
@classmethod
|
|
191
203
|
def to_json(cls, node: MDChildNode) -> list[dict]:
|
|
192
204
|
result = []
|
|
@@ -210,14 +222,17 @@ class ParagraphBlock(EditorJSBlock):
|
|
|
210
222
|
|
|
211
223
|
if child.get("value", "").endswith("/>"):
|
|
212
224
|
# self-closing
|
|
213
|
-
result.append(EditorJSCustom.to_json(
|
|
225
|
+
result.append(EditorJSCustom.to_json({"children": [child]}))
|
|
214
226
|
else:
|
|
215
|
-
# <editorjs
|
|
216
|
-
|
|
217
|
-
|
|
227
|
+
# <editorjs>...</editorjs> may include nested HTML; find the closing tag
|
|
228
|
+
end_idx = cls._find_closing_editorjs_tag(nodes, idx + 1)
|
|
229
|
+
children_slice = (
|
|
230
|
+
nodes[idx : idx + 2]
|
|
231
|
+
if end_idx is None
|
|
232
|
+
else nodes[idx : end_idx + 1]
|
|
218
233
|
)
|
|
219
|
-
|
|
220
|
-
|
|
234
|
+
skip = 2 if end_idx is None else end_idx - idx
|
|
235
|
+
result.extend(EditorJSCustom.to_json({"children": children_slice}))
|
|
221
236
|
|
|
222
237
|
continue
|
|
223
238
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: edwh-editorjs
|
|
3
|
-
Version: 2.6.
|
|
3
|
+
Version: 2.6.1
|
|
4
4
|
Summary: EditorJS.py
|
|
5
5
|
Project-URL: Homepage, https://github.com/educationwarehouse/edwh-EditorJS
|
|
6
6
|
Author-email: SKevo <skevo.cw@gmail.com>, Robin van der Noord <robin.vdn@educationwarehouse.nl>
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
editorjs/__about__.py,sha256=
|
|
1
|
+
editorjs/__about__.py,sha256=yv0wJuq7dd_PlBhLN8iuPUYVsoACKuk2R3Gg5WU-tHk,22
|
|
2
2
|
editorjs/__init__.py,sha256=-OHUf7ZXfkbdFB1r85eIjpHRfql-GCNUCKuBEdEt2Rc,58
|
|
3
|
-
editorjs/blocks.py,sha256=
|
|
3
|
+
editorjs/blocks.py,sha256=5FJwfky4QEiNPJxQ61O1D0nQ8eEVWu3a1Qhi79JJKco,30176
|
|
4
4
|
editorjs/core.py,sha256=4igv2l8Rm1S92kxKrIXGIUlNHh6pnjq8F28XQr91I9o,4510
|
|
5
5
|
editorjs/exceptions.py,sha256=oKuWqi4CSnFGZfVZWtTZ2XZeHXm5xF-nAtX_1YLm6sI,230
|
|
6
6
|
editorjs/helpers.py,sha256=q861o5liNibMTp-Ozay17taF7CTNsRe901lYhhxdwHg,73
|
|
7
7
|
editorjs/types.py,sha256=W7IZWMWgzJaQulybIt0Gx5N63rVj4mEy73VJWo4VAQA,1029
|
|
8
|
-
edwh_editorjs-2.6.
|
|
9
|
-
edwh_editorjs-2.6.
|
|
10
|
-
edwh_editorjs-2.6.
|
|
8
|
+
edwh_editorjs-2.6.1.dist-info/METADATA,sha256=pUeVwld9qEefDaWs0azSpu8mz-2FSq6HlrkZpvWqT-I,1045
|
|
9
|
+
edwh_editorjs-2.6.1.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
10
|
+
edwh_editorjs-2.6.1.dist-info/RECORD,,
|
|
File without changes
|