edwh-editorjs 2.2.1__tar.gz → 2.2.2__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.
Files changed (30) hide show
  1. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/CHANGELOG.md +6 -0
  2. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/PKG-INFO +1 -1
  3. edwh_editorjs-2.2.2/editorjs/__about__.py +1 -0
  4. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/editorjs/blocks.py +3 -3
  5. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/editorjs/core.py +2 -2
  6. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/tests/test_core.py +16 -0
  7. edwh_editorjs-2.2.1/editorjs/__about__.py +0 -1
  8. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/.github/workflows/build_documentation.yml +0 -0
  9. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/.github/workflows/publish_to_pypi.yml +0 -0
  10. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/.github/workflows/pytest.yml +0 -0
  11. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/.gitignore +0 -0
  12. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/README.md +0 -0
  13. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/editorjs/__init__.py +0 -0
  14. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/editorjs/exceptions.py +0 -0
  15. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/editorjs/helpers.py +0 -0
  16. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/editorjs/types.py +0 -0
  17. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/.gitignore +0 -0
  18. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/class_index.html +0 -0
  19. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/favicon_32_cb_58284776.png +0 -0
  20. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/function_index.html +0 -0
  21. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/index.html +0 -0
  22. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/keybd_closed_cb_ce680311.png +0 -0
  23. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/status.json +0 -0
  24. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/style_cb_8e611ae1.css +0 -0
  25. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/z_a93c8aeb4b8fa1f9___init___py.html +0 -0
  26. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/z_a93c8aeb4b8fa1f9_blocks_py.html +0 -0
  27. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/z_a93c8aeb4b8fa1f9_exceptions_py.html +0 -0
  28. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/htmlcov/z_a93c8aeb4b8fa1f9_parser_py.html +0 -0
  29. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/pyproject.toml +0 -0
  30. {edwh_editorjs-2.2.1 → edwh_editorjs-2.2.2}/tests/__init__.py +0 -0
@@ -2,6 +2,12 @@
2
2
 
3
3
  <!--next-version-placeholder-->
4
4
 
5
+ ## v2.2.2 (2024-11-26)
6
+
7
+ ### Fix
8
+
9
+ * Support 'html' as alias for 'raw' block ([`4627f90`](https://github.com/educationwarehouse/edwh-editorjs/commit/4627f900a30bf6d6b202790958a78d4ef745ee11))
10
+
5
11
  ## v2.2.1 (2024-11-26)
6
12
 
7
13
  ### Fix
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: edwh-editorjs
3
- Version: 2.2.1
3
+ Version: 2.2.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>
@@ -0,0 +1 @@
1
+ __version__ = "2.2.2"
@@ -470,7 +470,7 @@ class QuoteBlock(EditorJSBlock):
470
470
  return default_to_text(node)
471
471
 
472
472
 
473
- @block("raw")
473
+ @block("raw", "html")
474
474
  class RawBlock(EditorJSBlock):
475
475
 
476
476
  @classmethod
@@ -480,11 +480,11 @@ class RawBlock(EditorJSBlock):
480
480
 
481
481
  @classmethod
482
482
  def to_json(cls, node: MDChildNode) -> list[dict]:
483
- raise TODO(node)
483
+ return [raw_block(cls.to_text(node))]
484
484
 
485
485
  @classmethod
486
486
  def to_text(cls, node: MDChildNode) -> str:
487
- raise TODO(node)
487
+ return node.get("value", "")
488
488
 
489
489
 
490
490
  @block("table")
@@ -41,7 +41,7 @@ class EditorJS:
41
41
  for child in blocks:
42
42
  _type = child["type"]
43
43
  if not (block := BLOCKS.get(_type)):
44
- raise TypeError(f"Unsupported block type `{_type}`")
44
+ raise TypeError(f"from_json: Unsupported block type `{_type}`")
45
45
 
46
46
  data = child.get("data", {})
47
47
  # forward any 'tunes' via data:
@@ -76,7 +76,7 @@ class EditorJS:
76
76
  for child in self._mdast["children"]:
77
77
  _type = child["type"]
78
78
  if not (block := BLOCKS.get(_type)):
79
- raise TypeError(f"Unsupported block type `{_type}`")
79
+ raise TypeError(f"to_json: Unsupported block type `{_type}`")
80
80
 
81
81
  blocks.extend(block.to_json(child))
82
82
 
@@ -156,6 +156,22 @@ def test_raw_html():
156
156
  print(e.to_markdown())
157
157
  assert " " not in e.to_markdown(), "added too many whitespaces"
158
158
 
159
+ another_md = r"""<marquee> <kaas>mannetje </kaas> </marquee> <yep>pa
160
+
161
+ </yep>
162
+
163
+ sdafasdgasdgdsag
164
+
165
+ asdfsadfsdf dsfasdf
166
+
167
+ asdfsdajgdsjaklgkjds
168
+ """
169
+
170
+ e = EditorJS.from_markdown(another_md)
171
+ print(e.to_markdown())
172
+ print(e.to_json())
173
+ assert e.to_json()
174
+
159
175
 
160
176
  def test_code():
161
177
  e = EditorJS.from_markdown(textwrap.dedent("""
@@ -1 +0,0 @@
1
- __version__ = "2.2.1"
File without changes
File without changes