edwh-editorjs 2.0.1__py3-none-any.whl → 2.0.2__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.0.
|
|
1
|
+
__version__ = "2.0.2"
|
editorjs/blocks.py
CHANGED
|
@@ -130,6 +130,14 @@ class HeadingBlock(EditorJSBlock):
|
|
|
130
130
|
return child.get("value", "")
|
|
131
131
|
|
|
132
132
|
|
|
133
|
+
def paragraph_block(text: str):
|
|
134
|
+
return {"type": "paragraph", "data": {"text": text}}
|
|
135
|
+
|
|
136
|
+
|
|
137
|
+
def raw_block(html: str):
|
|
138
|
+
return {"type": "raw", "data": {"html": html}}
|
|
139
|
+
|
|
140
|
+
|
|
133
141
|
@block("paragraph")
|
|
134
142
|
class ParagraphBlock(EditorJSBlock):
|
|
135
143
|
@classmethod
|
|
@@ -173,9 +181,10 @@ class ParagraphBlock(EditorJSBlock):
|
|
|
173
181
|
|
|
174
182
|
elif _type == "image":
|
|
175
183
|
if current_text:
|
|
176
|
-
|
|
184
|
+
# {"id":"zksvpxQTDD","type":"raw","data":{"html":"<marquee> raw </marquee>"}}
|
|
185
|
+
result.append(raw_block(current_text) if any_html else paragraph_block(current_text))
|
|
177
186
|
current_text = ""
|
|
178
|
-
any_html = False
|
|
187
|
+
any_html = False # reset
|
|
179
188
|
|
|
180
189
|
result.extend(ImageBlock.to_json(child))
|
|
181
190
|
else:
|
|
@@ -194,7 +203,7 @@ class ParagraphBlock(EditorJSBlock):
|
|
|
194
203
|
|
|
195
204
|
# final text after image:
|
|
196
205
|
if current_text:
|
|
197
|
-
result.append(
|
|
206
|
+
result.append(raw_block(current_text) if any_html else paragraph_block(current_text))
|
|
198
207
|
|
|
199
208
|
return result
|
|
200
209
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: edwh-editorjs
|
|
3
|
-
Version: 2.0.
|
|
3
|
+
Version: 2.0.2
|
|
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=tATvJM5shAzfspHYjdVwpV2w3-gDA119NlEYi5X2lFY,22
|
|
2
2
|
editorjs/__init__.py,sha256=-OHUf7ZXfkbdFB1r85eIjpHRfql-GCNUCKuBEdEt2Rc,58
|
|
3
|
-
editorjs/blocks.py,sha256=
|
|
3
|
+
editorjs/blocks.py,sha256=LN7u3p_VT5kYn5FL_IW2MHoHDh_9JjcnlDPbf_0d4M8,22128
|
|
4
4
|
editorjs/core.py,sha256=CdZnprX-vkjFJATxPfG1acDqGKkHa3mDfbMEeXiR6eI,3331
|
|
5
5
|
editorjs/exceptions.py,sha256=TyfHvk2Z5RbKxTDK7lrjgwAgVgInXIuDW63eO5jzVFw,106
|
|
6
6
|
editorjs/helpers.py,sha256=q861o5liNibMTp-Ozay17taF7CTNsRe901lYhhxdwHg,73
|
|
7
7
|
editorjs/types.py,sha256=W7IZWMWgzJaQulybIt0Gx5N63rVj4mEy73VJWo4VAQA,1029
|
|
8
|
-
edwh_editorjs-2.0.
|
|
9
|
-
edwh_editorjs-2.0.
|
|
10
|
-
edwh_editorjs-2.0.
|
|
8
|
+
edwh_editorjs-2.0.2.dist-info/METADATA,sha256=kZ1FReSETMZKdmVEPAzh_Vk0Te7I3d4G5Edc8fd5TRE,972
|
|
9
|
+
edwh_editorjs-2.0.2.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
10
|
+
edwh_editorjs-2.0.2.dist-info/RECORD,,
|
|
File without changes
|