Releases: fellowapp/prosemirror-py
Releases · fellowapp/prosemirror-py
v0.6.1
This release focuses on closing behavioral gaps with the upstream TypeScript ProseMirror modules. Over 25 bugs have been fixed to improve correctness and compatibility.
Upstream Compatibility
UTF-16 Semantics
- Fix UTF-16 slicing in
TextNode.text_betweenandFragment.text_between— Python string slicing uses codepoints, but ProseMirror positions are in UTF-16 code units - Fix UTF-16 character counting in
diff.py—find_diff_startandfind_diff_endproduced wrong positions for text with non-BMP characters (e.g. emoji)
DOM Parsing
- Fix
parse_slice()missing thelxmltextwrapping needed for lxml to handle text nodes (was only applied inparse()) - Remove incorrect
preserve_whitespace=Truedefault inparse_slice()— upstream lets it inherit from context - Fix
ruleFromNodefallback logic — whenruleFromNodereturned falsy, thematchTagresult was dropped instead of used as fallback
DOM Serialization
- Handle
{dom, contentDOM}dict variant inrender_spec, matching the TypeScriptDOMOutputSpectype - Coerce attribute values to string in
render_spec— TypeScript'ssetAttributedoes this implicitly - Cache
DOMSerializerinfrom_schema()(upstream caches onschema.cached)
Node & Fragment
- Fix
Node.cut()not resolving defaulttoparameter before the early-return check - Add
textattribute to baseNodeclass (returnsNone), matchingNode.prototype.text = undefinedin TypeScript - Reject negative indices in
child()andmaybe_child()— Python lists silently accept them, TypeScript arrays don't - Make
Fragment.cut_by_indexrequire both parameters to match upstream API surface
Schema & Attributes
- Distinguish explicit
Nonefrom missing incompute_attrsusing a sentinel — TypeScript distinguishesnullfromundefined - Map
dictandlistto"object"in_validate_typeto match JavaScript'stypeof - Add
elseclause for unknown expression types in NFAcompile(upstream throws, Python silently returnedNone)
Resolved Positions
- Make
ResolvedPos.index_afterdepth parameter optional, matching upstream
Content Matching & Replace
- Fix
check_contentusage inclose()to match upstream error semantics — was raisingReplaceErrorinstead ofValueError - Fix infinite loop in
matches_context() - Fix operator precedence in
NodeContext.finish() - Fix logic inversion in
ignore_fallback()
Other API Fixes
- Change
textBetweendefaults toNoneto match upstream (was defaulting to empty strings) - Add diagnostic hint to
Fragment.from_()error message about multiple versions - Add missing exports to
prosemirror.model:AttributeSpec,GenericParseRule,HTMLOutputSpec,MarkSpec,NodeSpec,ParseOptions,ParseRule,SchemaSpec,StyleParseRule,TagParseRule
Bug Fixes
- Fix memory leak in resolve cache — added weakref finalizer to clean up entries when documents are garbage collected
CI & Tooling
- Add Python 3.14 to test matrix
- Add pre-commit config for ruff, ty, and pytest
v0.6.0
Upstream Sync Summary
This release brings major upstream synchronization across all ProseMirror sub-packages:
| Package | v0.5.2 | Current |
|---|---|---|
prosemirror-model |
1.18.1 | 1.25.4 |
prosemirror-transform |
1.8.0 | 1.11.0 |
prosemirror-schema-basic |
1.1.2 | 1.2.4 |
prosemirror-schema-list |
(unversioned) | 1.5.1 |
prosemirror-test-builder |
(unversioned) | 1.1.1 |
Features
- prosemirror-model 1.18.2 → 1.25.4 — 16 upstream releases synced, including:
- New DOM serialization and parsing improvements
- Schema enhancements and new APIs
- Fragment and resolved position updates
- Content expression and diff improvements
- prosemirror-transform 1.9.0 → 1.11.0 — 8 upstream releases synced, including:
- New structure manipulation capabilities
- Replace step improvements
- Step mapping enhancements
- New transform methods and exports
- Pre-existing bug fixes in the Python translation
- prosemirror-schema-basic 1.2.4 — Updated schema definitions
- prosemirror-schema-list 1.5.1 — Updated list node specs and
wrapRangeInList(command functions depending onprosemirror-stateremain excluded) - prosemirror-test-builder 1.1.1 — Updated test builder utilities
Bug Fixes
- Fix pre-existing bugs in prosemirror-transform Python translation
- Add missing
codefield toMarkSpecTypedDict - Add missing tests and exports for prosemirror-transform
- Resolve
tytype checking errors - Align Python translation with upstream prosemirror-model 1.18.1
Chores / Tooling
- Replace
pyrightwithtyfor type checking - Add
uv.lockto.gitignore - Add PyPI metadata to
pyproject.toml - Update
actions/checkoutto v5 and v6 - Update
actions/setup-pythonto v6 - Update CI Python version to 3.14
v0.5.2
v0.5.1 (2024-11-18)
What's Changed
- Fix handling of indented HTML in DOMParser by @mattmikolay in #315
New Contributors
- @mattmikolay made their first contribution in #315
Full Changelog: v0.5.0...v0.5.1
What's Changed
- Fix handling of indented HTML in DOMParser by @mattmikolay in #315
- Update pytest-cov and fix formatting changes by @sciyoshi in #319
New Contributors
- @mattmikolay made their first contribution in #315
Full Changelog: v0.5.0...v0.5.1
What's Changed
- Fix handling of indented HTML in DOMParser by @mattmikolay in #315
- Update pytest-cov and fix formatting changes by @sciyoshi in #319
New Contributors
- @mattmikolay made their first contribution in #315
Full Changelog: v0.5.0...v0.5.1
v0.5.0 (2024-04-22)
What's Changed
- Switch to uv and setuptools by @sciyoshi in #311
- Drop support for Python < 3.10 and add additional Ruff rules by @sciyoshi in #313
- Rename is_text_block to is_textblock to match upstream
Full Changelog: v0.4.0...v0.5.0
v0.4.0 (2023-11-16)
What's Changed
- Add types for prosemirror.model by @sciyoshi in #233
- Update packages, switch to ruff format by @sciyoshi in #285
Full Changelog: v0.3.7...v0.4.0
v0.3.7 (2023-11-02)
Re-release of v0.3.6.
v0.3.6 (2023-11-02)
Updates prosemirror-transform to 1.8.0.
What's Changed
- Added from_dom.py to be able to convert markup to prose format in py by @dennmat-hurdle in #227
- Bump pytest from 7.3.1 to 7.4.1 by @dependabot in #261
- Bump ruff from 0.0.271 to 0.0.287 by @dependabot in #260
- Bump lxml from 4.9.2 to 4.9.3 by @dependabot in #243
- Bump pydash from 7.0.4 to 7.0.6 by @dependabot in #249
- Bump flake8 from 6.0.0 to 6.1.0 by @dependabot in #250
- Bump typing-extensions from 4.6.3 to 4.8.0 by @dependabot in #266
- Bump black from 23.3.0 to 23.9.1 by @dependabot in #265
- Bump coverage from 7.2.7 to 7.3.2 by @dependabot in #264
- Bump mypy from 1.3.0 to 1.6.0 by @dependabot in #263
- Bump urllib3 from 2.0.3 to 2.0.6 by @dependabot in #262
- Bump certifi from 2023.5.7 to 2023.7.22 by @dependabot in #248
- 1.7.1-1.7.5 by @johanneswilm in #271
- add docAttr step by @johanneswilm in #270
New Contributors
- @dennmat-hurdle made their first contribution in #227
- @johanneswilm made their first contribution in #271
Full Changelog: v0.3.5...v0.3.6
v0.3.5 (2023-06-07)
Re-release of 0.3.4.
Full Changelog: v0.3.4...v0.3.5
v0.3.4 (2023-06-07)
What's Changed
- Add suport for attr_step by @smores in #210
- Port prosemirror-transform changes up to 1.7.1 by @p7g in #211
- Update ruff to 0.0.269 by @sciyoshi in #213
- Bump typing-extensions from 4.4.0 to 4.5.0 by @dependabot in #185
- Update packages by @sciyoshi in #217
- Bump requests from 2.28.2 to 2.31.0 by @dependabot in #218
- Bump typing-extensions from 4.5.0 to 4.6.1 by @dependabot in #220
- Bump coverage from 7.0.5 to 7.2.6 by @dependabot in #221
- Add initial release workflow by @sciyoshi in #222
- Bump pytest-cov from 4.0.0 to 4.1.0 by @dependabot in #223
- Bump coverage from 7.2.6 to 7.2.7 by @dependabot in #226
- Bump typing-extensions from 4.6.1 to 4.6.3 by @dependabot in #228
- Bump pydash from 7.0.3 to 7.0.4 by @dependabot in #229
- Bump ruff from 0.0.269 to 0.0.271 by @dependabot in #230
New Contributors
- @smores made their first contribution in #210
- @dependabot made their first contribution in #185
Full Changelog: v0.3.3...v0.3.4