edwh-editorjs 2.2.0__tar.gz → 2.2.1__tar.gz
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.
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/CHANGELOG.md +6 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/PKG-INFO +1 -1
- edwh_editorjs-2.2.1/editorjs/__about__.py +1 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/editorjs/core.py +3 -1
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/tests/test_core.py +17 -2
- edwh_editorjs-2.2.0/editorjs/__about__.py +0 -1
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/.github/workflows/build_documentation.yml +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/.github/workflows/publish_to_pypi.yml +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/.github/workflows/pytest.yml +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/.gitignore +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/README.md +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/editorjs/__init__.py +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/editorjs/blocks.py +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/editorjs/exceptions.py +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/editorjs/helpers.py +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/editorjs/types.py +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/.gitignore +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/class_index.html +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/favicon_32_cb_58284776.png +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/function_index.html +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/index.html +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/keybd_closed_cb_ce680311.png +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/status.json +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/style_cb_8e611ae1.css +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/z_a93c8aeb4b8fa1f9___init___py.html +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/z_a93c8aeb4b8fa1f9_blocks_py.html +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/z_a93c8aeb4b8fa1f9_exceptions_py.html +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/htmlcov/z_a93c8aeb4b8fa1f9_parser_py.html +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/pyproject.toml +0 -0
- {edwh_editorjs-2.2.0 → edwh_editorjs-2.2.1}/tests/__init__.py +0 -0
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
<!--next-version-placeholder-->
|
|
4
4
|
|
|
5
|
+
## v2.2.1 (2024-11-26)
|
|
6
|
+
|
|
7
|
+
### Fix
|
|
8
|
+
|
|
9
|
+
* Quick fix to prevent unlimited spaces being added by mdast ([`a196a22`](https://github.com/educationwarehouse/edwh-editorjs/commit/a196a221b623f7d4808aec64ef455197bdcfacaf))
|
|
10
|
+
|
|
5
11
|
## v2.2.0 (2024-11-26)
|
|
6
12
|
|
|
7
13
|
### Feature
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: edwh-editorjs
|
|
3
|
-
Version: 2.2.
|
|
3
|
+
Version: 2.2.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>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "2.2.1"
|
|
@@ -92,7 +92,9 @@ class EditorJS:
|
|
|
92
92
|
# idk why this happens:
|
|
93
93
|
md = md.replace(r"\[ ]", "[ ]")
|
|
94
94
|
md = md.replace(r"\[x]", "[x]")
|
|
95
|
-
return md
|
|
95
|
+
return md.replace(
|
|
96
|
+
" <", " <"
|
|
97
|
+
) # replace double space (added by mdast) with single one
|
|
96
98
|
|
|
97
99
|
def to_mdast(self) -> str:
|
|
98
100
|
"""
|
|
@@ -135,12 +135,27 @@ def test_raw_html():
|
|
|
135
135
|
e = EditorJS.from_json(raw_html_json)
|
|
136
136
|
blocks = json.loads(e.to_json())
|
|
137
137
|
|
|
138
|
-
print(blocks)
|
|
139
|
-
|
|
140
138
|
assert blocks["blocks"][0]["type"] == "paragraph", blocks["blocks"][0]["type"]
|
|
141
139
|
assert blocks["blocks"][1]["type"] == "raw", blocks["blocks"][1]["type"]
|
|
142
140
|
assert blocks["blocks"][2]["type"] == "paragraph", blocks["blocks"][2]["type"]
|
|
143
141
|
|
|
142
|
+
raw_html_json = r"""[{"id":"xGbqrb40Uz","type":"raw","data":{"html":"<marquee><kaas>mannetje</kaas></marquee>"}}]"""
|
|
143
|
+
|
|
144
|
+
e = EditorJS.from_json(raw_html_json)
|
|
145
|
+
|
|
146
|
+
print(e.to_mdast(), e.to_markdown())
|
|
147
|
+
e = EditorJS.from_markdown(e.to_markdown())
|
|
148
|
+
print(e.to_mdast(), e.to_markdown())
|
|
149
|
+
|
|
150
|
+
e = EditorJS.from_markdown(e.to_markdown())
|
|
151
|
+
e = EditorJS.from_markdown(e.to_markdown())
|
|
152
|
+
e = EditorJS.from_markdown(e.to_markdown())
|
|
153
|
+
e = EditorJS.from_markdown(e.to_markdown())
|
|
154
|
+
e = EditorJS.from_markdown(e.to_markdown())
|
|
155
|
+
|
|
156
|
+
print(e.to_markdown())
|
|
157
|
+
assert " " not in e.to_markdown(), "added too many whitespaces"
|
|
158
|
+
|
|
144
159
|
|
|
145
160
|
def test_code():
|
|
146
161
|
e = EditorJS.from_markdown(textwrap.dedent("""
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
__version__ = "2.2.0"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|