Skip to content

v2.1.1

Choose a tag to compare

@Samyssmile Samyssmile released this 02 May 11:08

Fixed

  • Code-block input rule loses the language attribute (#113) — Typing ```<lang> + space converts a paragraph to a code_block via a single transaction containing both deleteText and setBlockType. The TextDirectionAutoPlugin's auto-detect middleware appended its own setNodeAttr step built from a pre-transaction block.attrs snapshot; applySetNodeAttr has full-replace semantics, so by application time the snapshot was stale and clobbered the { language, backgroundColor } attrs written by setBlockType. The result was a code block with language: '', no language label and no syntax highlighting. Auto-detect now pre-scans the transaction for blocks already targeted by setBlockType or setNodeAttr and skips its emission for those blocks — symmetrical to the guards already present in the preserve-dir and inherit-dir middlewares. The next text-only transaction re-detects direction normally. Generally fixes the same data-loss pattern for any future input rule or command that combines text edits with a block-type or attr change in a single atomic transaction.

Full Changelog: v2.1.0...v2.1.1