Changelogs >

Prosemirror

PyUp actively tracks 437,546 Python packages for vulnerabilities to keep your Python environments secure.

Scan your dependencies

1.18.1

Bug fixes

Upgrade to orderedmap 2.0.0 to avoid around a TypeScript compilation issue.

1.18.0

New features

Node specs for leaf nodes now support a property `leafText` which, when given, will be used by `textContent` and `textBetween` to serialize the node.

Add optional type parameters to `Schema` for the node and mark names. Clarify Schema type parameters

1.17.0

Bug fixes

Fix a crash in DOM parsing.

New features

Include TypeScript type declarations.

1.16.1

Bug fixes

Fix a bug in the way whitespace-preservation options were handled in `DOMParser`.

1.16.0

New features

A new `NodeSpec` property, `whitespace`, allows more control over the way whitespace in the content of the node is parsed.

1.15.0

New features

`textBetween` now allows its leaf text argument to be a function.

1.14.3

Bug fixes

`DOMSerializer.serializeNode` will no longer ignore the node's marks.

1.14.2

Bug fixes

Be less agressive about dropping whitespace when the context isn't know in `DOMParser.parseSlice`.

1.14.1

Bug fixes

DOM parsing with `preserveWhitespace: "full"` will no longer ignore whitespace-only nodes.

1.14.0

Bug fixes

`Node.check` will now error if a node has an invalid combination of marks.

Don't leave carriage return characters in parsed DOM content, since they confuse Chrome's cursor motion.

New features

`Fragment.textBetween` is now public.

1.13.3

Bug fixes

Fix an issue where nested tags that match mark parser rules could cause the parser to apply marks in invalid places.

1.13.2

Bug fixes

`MarkType.removeFromSet` now removes all instances of the mark, not just the first one.

1.13.1

Bug fixes

Fix a bug where nested marks of the same type would be applied to the wrong node when parsing from DOM.

1.13.0

New features

Parse rules can now have a `consuming: false` property which allows other rules to match their tag or style even when they apply.

1.12.0

New features

The output of `toDOM` functions can now be a `{dom, contentDOM}` object specifying the precise parent and content DOM elements.

1.11.2

Bug fixes

Fix issue where 1.11.1 uses an array method not available on Internet Explorer.

1.11.1

Bug fixes

Fix an issue where an inner node's mark information could reset the same mark provided by an outer node in the DOM parser.

1.11.0

New features

Resolved positions have a new convenience method, `posAtIndex`, which can resolve a depth and index to a position.

1.10.1

Bug fixes

Fix a bug that prevented non-canonical list structure from being normalized.

1.10.0

Bug fixes

Avoid fixing directly nested list nodes during DOM parsing when it looks like the schema allows those.

New features

DOM parser rules can now specify `closeParent: true` to have the effect of closing their parent node when matched.

1.9.1

Bug fixes

Marks found in the DOM at the wrong level (for example, a bold style on a block node) are now properly moved to the node content.

1.9.0

New features

The `NodeType` method [`hasRequiredAttrs`](https://prosemirror.net/docs/ref/#model.NodeType.hasRequiredAttrs) is now public.

Element and attribute names in [`DOMOutputSpec`](https://prosemirror.net/docs/ref/#model.DOMOutputSpec) structures can now contain namespaces.

1.8.2

Bug fixes

Rename ES module files to use a .js extension, since Webpack gets confused by .mjs

1.8.1

Bug fixes

The file referred to in the package's `module` field now is compiled down to ES5.

1.8.0

New features

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

Add a `module` field to package json file.

1.7.5

Bug fixes

`ContentMatch.edge` now throws, as it is supposed to, when you try to access the edge past the last one.

1.7.4

Bug fixes

Fix an issue where `fillBefore` would in some cases insert unneccesary optional child nodes in the generated content.

1.7.3

Bug fixes

Fix an issue where _any_ whitespace (not just the characters that HTML collapses) was collapsed by the parser in non-whitespace-preserving mode.

1.7.2

Bug fixes

When `<br>` DOM nodes can't be parsed normally, the parser now converts them to newlines. This should improve parsing of some forms of source code HTML.

1.7.1

Bug fixes

Using `Fragment.from` on an invalid value, including a `Fragment` instance from a different version/instance of the library, now raises a meaningful error rather than getting confused.

Fix a bug in parsing overlapping marks of the same non-self-exclusive type.

1.7.0

New features

Mark specs now support a property [`spanning`](https://prosemirror.net/docs/ref/#model.MarkSpec.spanning) which, when set to `false`, prevents the mark's DOM markup from spanning multiple nodes, so that a separate wrapper is created for each adjacent marked node.

1.6.4

Bug fixes

Don't output empty style attributes when a style property with a null value is present in `renderSpec`.

1.6.3

Bug fixes

The DOM parser now drops whitespace after BR nodes when not in whitespace-preserving mode.

1.6.2

Bug fixes

Prevent [`ContentMatch.findWrapping`](https://prosemirror.net/docs/ref/#model.ContentMatch.findWrapping) from returning node types with required attributes.

1.6.1

Bug fixes

Fix a bug where marks were sometimes parsed incorrectly.

1.6.0

Bug fixes

Allow replace steps to be mapped through changes that delete content next to their start and end points, as long as no delete spans across those points.

New features

`MapResult` objects now provide information about whether the tokens before, after, and around the position were deleted.

1.5.0

New features

Include TypeScript type declarations.

1.4.4

Bug fixes

Fix a regression where `DOMParser.parse` would fail to apply mark nodes directly at the start of the input.

1.4.3

Bug fixes

[`DOMParser.parseSlice`](https://prosemirror.net/docs/ref/#model.DOMParser.parseSlice) can now correctly parses marks at the top level again.

1.4.2

Bug fixes

Make replacements that span to the end of a textblock more consistent with those ending in the middle of the block.

1.4.1

Bug fixes

`replaceRange` will now close multiple defining parent nodes when appropriate.

1.4.0

New features

Node specs can now use the `definingForContent` and `definingAsContext` properties to opt in to specific parts of the existing `defining` behavior.

1.3.4

Bug fixes

Make sure that constructing an empty `StepMap` returns `StepMap.empty`.

1.3.3

Bug fixes

Fix an inconsistency in `deleteRange` where it would delete the parent node for ranges covering all textblocks in a given parent.

1.3.2

Bug fixes

Fix a regression in `dropPoint` that caused it to dereference undefined in some circumstances.

1.3.1

Bug fixes

Fix a crash in `Transform.replaceRange` when called with under specific circumstances.

Fix an issue where `dropPoint` could return an invalid drop point.

1.3.0

New features

The various properties of subclasses of `Step` (`ReplaceStep`, `ReplaceAroundStep`, `AddMarkStep`, and `RemoveMarkStep`) are now part of the public interface.

1.2.12

Bug fixes

Fix a bug where merging replace steps with the `structure` flag could create steps that couldn't be applied.

1.2.11

Bug fixes

Fix an issue in `Transform.removeMark` where the mark type was passed through to be removed instead of the mark itself.

1.2.10

Bug fixes

Fix an issue where `Transform.removeMark`, when given a mark type, would only remove the first instance from nodes that had multiple marks of the type.

1.2.9

Bug fixes

Fix an issue where `AddMarkStep` would mark inline nodes with content.

1.2.8

Bug fixes

Fix an issue where fitting a slice at the top level of the document would, in some circumstances, crash.

1.2.7

Bug fixes

Fix an issue where in some cases replace fitting would insert an additional bogus node when fitting content into nodes with strict content restrictions.

1.2.6

Bug fixes

Fix an issue where creating a replace step would sometimes fail due to unmatchable close tokens after the replaced range.

1.2.5

Bug fixes

Rewrite the slice-fitting code used by `replaceStep` to handle a few more corner cases.

1.2.4

Bug fixes

Fix `joinPoint` to return check whether the parent node allows a given join.

1.2.3

Bug fixes

Fix a crash in `deleteRange` that occurred when deleting a region that spans to the ends of two nodes at different depths.

1.2.2

Bug fixes

Rename ES module files to use a .js extension, since Webpack gets confused by .mjs

1.2.1

Bug fixes

The file referred to in the package's `module` field now is compiled down to ES5.

1.2.0

New features

Add a `module` field to package json file.

1.1.6

Bug fixes

Fixes an issue where deleting a range from the start of block A to the end of block B would leave you with an empty block of type B.

1.1.5

Bug fixes

Fix crash in building replace steps for open-ended slices with complicated node content expressions.

1.1.4

Bug fixes

[`Mapping.invert`](https://prosemirror.net/docs/ref/#transform.Mapping.invert) is now part of the documented API (it was intented to be public from the start, but a typo prevented it from showing up in the docs).

Fix an issue where a replace could needlessly drop content when the first node of the slice didn't fit the target context.

`replaceRange` now more aggressively expands the replaced region if `replace` fails to place the slice.

1.1.3

Bug fixes

Replacing from a code block into a paragraph that has marks, or similar scenarios that would join content with the wrong marks into a node, no longer crashes.

1.1.2

Bug fixes

Fix issue where [`replaceRange`](https://prosemirror.net/docs/ref/#transform.Transform.replaceRange) might create invalid nodes.

1.1.1

Bug fixes

Fix issues in the new [`dropPoint`](https://prosemirror.net/docs/ref/#transform.dropPoint) function.

1.1.0

New features

Include TypeScript type declarations.

1.0.10

Bug fixes

[`Transform.setBlockType`](https://prosemirror.net/docs/ref/#transform.Transform.setBlockType) no longer drops marks on the nodes it updates.

1.0.9

Bug fixes

Fix a bug that made [`replaceStep`](https://prosemirror.net/docs/ref/#transform.replaceStep) unable to generate wrapper nodes in some circumstances.

1.0.8

Bug fixes

Fixes an issue where [`replaceStep`](https://prosemirror.net/docs/ref/#transform.replaceStep) could generate slices that internally violated the schema.

1.0.7

Bug fixes

[`Transform.deleteRange`](https://prosemirror.net/docs/ref/#transform.Transform.deleteRange) will cover unmatched opening at the start of the deleted range.

1.0.6

Bug fixes

Make it possible to specify multiple marks of the same type for a given piece of content.

1.0.5

Bug fixes

Go back to regular dependencies, so that the package works on NPM <7.

1.0.4

Bug fixes

Treat ProseMirror libraries as peer dependencies, to avoid duplicate libraries when using this.

1.0.3

Bug fixes

Rename ES module files to use a .js extension, since Webpack gets confused by .mjs

1.0.2

Bug fixes

The file referred to in the package's `module` field now is compiled down to ES5.

1.0.1

Bug fixes

Fix overly restrictive depencency version ranges.

1.0.0

First stable release.

0.24.0

Breaking changes

The `setNodeType` method on transforms is now more descriptively called [`setNodeMarkup`](https://prosemirror.net/docs/ref/version/0.24.0.html#transform.Transform.setNodeMarkup). The old name will continue to work with a warning until the next release.

0.23.1

Bug fixes

`NodeType.allowsMarks` and `allowedMarks` now actually work for nodes that allow only specific marks.

0.23.0

Breaking changes

[`Step.toJSON`](https://prosemirror.net/docs/ref/version/0.23.0.html#transform.Step.toJSON) no longer has a default implementation.

Steps no longer have an `offset` method. Map them through a map created with [`StepMap.offset`](https://prosemirror.net/docs/ref/version/0.23.0.html#transform.StepMap^offset) instead.

The `clearMarkup` method on [`Transform`](https://prosemirror.net/docs/ref/version/0.23.0.html#transform.Transform) is no longer supported (you probably needed [`clearIncompatible`](https://prosemirror.net/docs/ref/version/0.23.0.html#transform.Transform.clearIncompatible) anyway).

Bug fixes

Pasting a list item at the start of a non-empty textblock now wraps the textblock in a list.

Marks on open nodes at the left of a slice are no longer dropped by [`Transform.replace`](https://prosemirror.net/docs/ref/version/0.23.0.html#transform.Transform.replace).

New features

`StepMap` now has a static method [`offset`](https://prosemirror.net/docs/ref/version/0.23.0.html#transform.StepMap^offset), which can be used to create a map that offsets all positions by a given distance.

Transform objects now have a [`clearIncompatible`](https://prosemirror.net/docs/ref/version/0.23.0.html#transform.Transform.clearIncompatible) method that can help make sure a node's content matches another node type.

0.22.2

Bug fixes

Fix another bug in the way `canSplit` interpreted its `typesAfter` argument.

0.22.1

Bug fixes

Fix crash in [`canSplit`](https://prosemirror.net/docs/ref/version/0.22.0.html#transform.canSplit) when an array containing null fields is passed as fourth argument.

0.22.0

Bug fixes

[`canSplit`](https://prosemirror.net/docs/ref/version/0.22.0.html#transform.canSplit) now returns false when given custom after-split node types that don't match the content at that point.

Fixes [`canLift`](https://prosemirror.net/docs/ref/version/0.22.0.html#transform.canLift) incorrectly returning null when lifting into an isolating node.

0.21.1

Bug fixes

[`addMark`](https://prosemirror.net/docs/ref/version/0.21.0.html#transform.Transform.addMark) no longer assumes marks always [exclude](https://prosemirror.net/docs/ref/version/0.21.0.html#model.MarkSpec.excludes) only themselves.

`replaceRange`](https://prosemirror.net/docs/ref/version/0.21.0.html#transform.Transform.replaceRange) and [`deleteRange`](https://prosemirror.net/docs/ref/version/0.21.0.html#transform.Transform.deleteRange) will no longer expand the range across isolating node boundaries.

0.21.0

Breaking changes

The `openLeft` and `openRight` properties of `Slice` objects have been renamed to [`openStart`](https://prosemirror.net/docs/ref/version/0.21.0.html#model.Slice.openStart) and [`openEnd`](https://prosemirror.net/docs/ref/version/0.21.0.html#model.Slice.openEnd) to avoid confusion in right-to-left text. The old names will continue to work with a warning until the next release.

New features

Mark [serializing functions](https://prosemirror.net/docs/ref/version/0.21.0.html#model.MarkSpec.toDOM) now get a second parameter that indicates whether the mark's content is inline or block nodes.

Setting a mark serializer to `null` in a [`DOMSerializer`](https://prosemirror.net/docs/ref/version/0.21.0.html#model.DOMSerializer) can now be used to omit that mark when serializing.

Node specs support a new property [`isolating`](https://prosemirror.net/docs/ref/version/0.21.0.html#model.NodeSpec.isolating), which is used to disable editing actions like backspacing and lifting across such a node's boundaries.

0.20.0

Bug fixes

Fixes issue where replacing would sometimes unexpectedly split nodes.

0.19.0

Breaking changes

Link marks are now non-inclusive by default.

0.18.0

New features

[`Transform.setNodeType`](https://prosemirror.net/docs/ref/version/0.18.0.html#transform.Transform.setNodeType) now takes an optional argument to set the new node's attributes.

Steps now provide an [`offset`](https://prosemirror.net/docs/ref/version/0.18.0.html#transform.Step.offset) method, which makes it possible to create a copy the step with its position offset by a given amount.

[`docChanged`](https://prosemirror.net/docs/ref/version/0.18.0.html#transform.Transform.docChanged) is now a property on the `Transform` class, rather than its `Transaction` subclass.

`Mapping` instances now have [`invert`](https://prosemirror.net/docs/ref/version/0.18.0.html#transform.Mapping.invert) and [`appendMappingInverted`](https://prosemirror.net/docs/ref/version/0.18.0.html#transform.Mapping.appendMappingInverted) methods to make mapping through them in reverse easier.

0.17.0

Breaking changes

`Node.marksAt` was replaced with [`ResolvedPos.marks`](https://prosemirror.net/docs/ref/version/0.17.0.html#model.ResolvedPos.marks). It still works (with a warning) in this release, but will be removed in the next one.

0.15.0

Bug fixes

Fix bug where pasted/inserted content would sometimes get incorrectly closed at the right side.

0.14.1

Bug fixes

[`DOMParser.parseSlice`](https://prosemirror.net/docs/ref/version/0.14.0.html#model.DOMParser.parseSlice) will now ignore whitespace-only text nodes at the top of the slice.

0.14.0

New features

Parse rules now support [`skip`](https://prosemirror.net/docs/ref/version/0.14.0.html#model.ParseRule.skip) (skip outer element, parse content) and [`getContent`](https://prosemirror.net/docs/ref/version/0.14.0.html#model.ParseRule.getContent) (compute content using custom code) properties.

The `DOMSerializer` class now exports a static [`renderSpec`](https://prosemirror.net/docs/ref/version/0.14.0.html#model.DOMSerializer^renderSpec) method that can help render DOM spec arrays.

0.13.0

Bug fixes

Fix issue where [`Transform.replace`](https://prosemirror.net/docs/ref/version/0.13.0.html#transform.Transform.replace) would, in specific circumstances, unneccessarily drop content.

New features

The new [`Transform`](https://prosemirror.net/docs/ref/version/0.13.0.html#transform.Transform) method [`replaceRange`](https://prosemirror.net/docs/ref/version/0.13.0.html#transform.Transform.replaceRange), [`replaceRangeWith`](https://prosemirror.net/docs/ref/version/0.13.0.html#transform.Transform.replaceRangeWith), and [`deleteRange`](https://prosemirror.net/docs/ref/version/0.13.0.html#transform.Transform.deleteRange) provide a way to replace and delete content in a 'do what I mean' way, automatically expanding the replaced region over empty parent nodes and including the parent nodes in the inserted content when appropriate.

0.12.1

Bug fixes

Fix bug in `Transform.setBlockType` when used in a transform that already has steps.

0.12.0

Breaking changes

Mapped positions now count as deleted when the token to the
side specified by the `assoc` parameter is deleted, rather than when
both tokens around them are deleted. (This is usually what you already
wanted anyway.)

0.11.0

Breaking changes

Moved into a separate module.

The `Remapping` class was renamed to `Mapping` and works differently
(simpler, grows in only one direction, and has provision for mapping
through only a part of it).

[`Transform`](https://prosemirror.net/docs/ref/version/0.11.0.html#transform.Transform) objects now build up a `Mapping`
instead of an array of maps.

`PosMap` was renamed to [`StepMap`](https://prosemirror.net/docs/ref/version/0.11.0.html#transform.StepMap) to make it
clearer that this applies only to a single step (as opposed to
[`Mapping`](https://prosemirror.net/docs/ref/version/0.11.0.html#transform.Mapping).

The arguments to [`canSplit`](https://prosemirror.net/docs/ref/version/0.11.0.html#transform.canSplit) and
[`split`](https://prosemirror.net/docs/ref/version/0.11.0.html#transform.Transform.split) were changed to make it
possible to specify multiple split-off node types for splits with a
depth greater than 1.

Rename `joinable` to [`canJoin`](https://prosemirror.net/docs/ref/version/0.11.0.html#transform.canJoin).

New features

Steps can now be [merged](https://prosemirror.net/docs/ref/version/0.11.0.html#transform.Step.merge) in some
circumstances, which can be useful when storing a lot of them.