Skip to content

Releases: fellowapp/prosemirror-py

v0.6.1

21 Feb 15:42

Choose a tag to compare

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_between and Fragment.text_between — Python string slicing uses codepoints, but ProseMirror positions are in UTF-16 code units
  • Fix UTF-16 character counting in diff.pyfind_diff_start and find_diff_end produced wrong positions for text with non-BMP characters (e.g. emoji)

DOM Parsing

  • Fix parse_slice() missing the lxmltext wrapping needed for lxml to handle text nodes (was only applied in parse())
  • Remove incorrect preserve_whitespace=True default in parse_slice() — upstream lets it inherit from context
  • Fix ruleFromNode fallback logic — when ruleFromNode returned falsy, the matchTag result was dropped instead of used as fallback

DOM Serialization

  • Handle {dom, contentDOM} dict variant in render_spec, matching the TypeScript DOMOutputSpec type
  • Coerce attribute values to string in render_spec — TypeScript's setAttribute does this implicitly
  • Cache DOMSerializer in from_schema() (upstream caches on schema.cached)

Node & Fragment

  • Fix Node.cut() not resolving default to parameter before the early-return check
  • Add text attribute to base Node class (returns None), matching Node.prototype.text = undefined in TypeScript
  • Reject negative indices in child() and maybe_child() — Python lists silently accept them, TypeScript arrays don't
  • Make Fragment.cut_by_index require both parameters to match upstream API surface

Schema & Attributes

  • Distinguish explicit None from missing in compute_attrs using a sentinel — TypeScript distinguishes null from undefined
  • Map dict and list to "object" in _validate_type to match JavaScript's typeof
  • Add else clause for unknown expression types in NFA compile (upstream throws, Python silently returned None)

Resolved Positions

  • Make ResolvedPos.index_after depth parameter optional, matching upstream

Content Matching & Replace

  • Fix check_content usage in close() to match upstream error semantics — was raising ReplaceError instead of ValueError
  • Fix infinite loop in matches_context()
  • Fix operator precedence in NodeContext.finish()
  • Fix logic inversion in ignore_fallback()

Other API Fixes

  • Change textBetween defaults to None to 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

18 Feb 23:11

Choose a tag to compare

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 on prosemirror-state remain excluded)
  • prosemirror-test-builder 1.1.1 — Updated test builder utilities

Bug Fixes

  • Fix pre-existing bugs in prosemirror-transform Python translation
  • Add missing code field to MarkSpec TypedDict
  • Add missing tests and exports for prosemirror-transform
  • Resolve ty type checking errors
  • Align Python translation with upstream prosemirror-model 1.18.1

Chores / Tooling

  • Replace pyright with ty for type checking
  • Add uv.lock to .gitignore
  • Add PyPI metadata to pyproject.toml
  • Update actions/checkout to v5 and v6
  • Update actions/setup-python to v6
  • Update CI Python version to 3.14

v0.5.2

07 Mar 15:59

Choose a tag to compare

What's Changed

  • Add support for Python 3.13.

Full Changelog: v0.5.1...v0.5.2

v0.5.1 (2024-11-18)

18 Nov 19:40

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.5.0...v0.5.1

What's Changed

New Contributors

Full Changelog: v0.5.0...v0.5.1

What's Changed

New Contributors

Full Changelog: v0.5.0...v0.5.1

v0.5.0 (2024-04-22)

22 Apr 13:30

Choose a tag to compare

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)

16 Nov 20:15

Choose a tag to compare

What's Changed

Full Changelog: v0.3.7...v0.4.0

v0.3.7 (2023-11-02)

02 Nov 17:07
8b3c7e5

Choose a tag to compare

Re-release of v0.3.6.

v0.3.6 (2023-11-02)

02 Nov 17:04
c8b31ae

Choose a tag to compare

Updates prosemirror-transform to 1.8.0.

What's Changed

New Contributors

Full Changelog: v0.3.5...v0.3.6

v0.3.5 (2023-06-07)

07 Jun 14:22

Choose a tag to compare

Re-release of 0.3.4.

Full Changelog: v0.3.4...v0.3.5

v0.3.4 (2023-06-07)

07 Jun 14:19
c0470f8

Choose a tag to compare

What's Changed

New Contributors

Full Changelog: v0.3.3...v0.3.4