prosemirror-model
Advanced tools
Changelog
1.2.2 (2018-03-15)
Throw errors, rather than constructing invalid objects, when deserializing from invalid JSON data.
Changelog
1.2.1 (2018-03-15)
Content expressions with text nodes in required positions now raise the appropriate error about being unable to generate such nodes.
Changelog
1.2.0 (2018-03-14)
rangeHasMark
now always returns false for empty ranges.
The DOM renderer no longer needlessly splits mark nodes when starting a non-rendered mark.
DOMSerializer
now allows DOM specs for marks to have holes in them, to specify the precise position where their content should be rendered.
The base position parameter to Node.nodesBetween
and Fragment.nodesBetween
is now part of the public interface.
Changelog
1.1.0 (2018-01-05)
Slice.maxOpen
now has a second argument that can be used to prevent it from opening isolating nodes.
Changelog
1.0.0 (2017-10-13)
ParseRule.context
may now include multiple, pipe-separated context expressions.
Changelog
0.23.1 (2017-09-21)
NodeType.allowsMarks
and allowedMarks
now actually work for nodes that allow only specific marks.
Changelog
0.23.0 (2017-09-13)
ResolvedPos.marks
no longer takes a parameter (you probably want marksAcross
if you were passing true there).
Attribute and mark constraints in content expressions are no longer supported (this also means the prosemirror-schema-table
package, which relied on them, is no longer supported). In this release, mark constraints are still (approximately) recognized with a warning, when present.
ContentMatch
objects lost a number of methods: matchNode
, matchToEnd
, findWrappingFor
(which can be easily emulated using the remaining API), and allowsMark
, which is now the responsibility of node types instead.
ContentMatch.validEnd
is now a property rather than a method.
ContentMatch.findWrapping
now returns an array of plain node types, with no attribute information (since this is no longer necessary).
The compute
method for attributes is no longer supported.
Fragments no longer have an offsetAt
method.
DOMParser.schemaRules
is no longer public (use fromSchema
and get the resulting parser's rules
property instead).
The DOM parser option topStart
has been replaced by topMatch
.
The DOMSerializer
methods nodesFromSchema
and marksFromSchema
are no longer public (construct a serializer with fromSchema
and read its nodes
and marks
properties instead).
Fix issue where whitespace at node boundaries was sometimes dropped during content parsing.
Attribute default values of undefined
are now allowed.
contentElement
in parse rules may now be a function.
The new method ResolvedPos.marksAcross
can be used to find the set of marks that should be preserved after a deletion.
Content expressions are now a regular language, meaning all the operators can be nested and composed as desired, and a bunch of constraints on what could appear next to what have been lifted.
The starting content match for a node type now lives in NodeType.contentMatch
.
Allowed marks are now specified per node, rather than in content expressions, using the marks
property on the node spec.
Node types received new methods allowsMarkType
, allowsMarks
, and allowedMarks
, which tell you about the marks that node supports.
The style
property on parse rules may now have the form "font-style=italic"
to only match styles that have the value after the equals sign.