Version Changelog
New features
Fragment.content
and Node.children
now expose a node's set of children as an array.
Bug fixes
Fix an issue on Safari where the (incorrect) top-level selection was used, instead of the workaround that also works inside shadow roots.
New features
Mark views can now provide an ignoreMutation
method. Add ViewMutationRecord to doc template
Bug fixes
Don't recreated TrustedTypePolicy
objects for every paste.
New features
Add support for a destroy
method on custom mark views. Add MarkView to the doc template
New features
The new NodeView.multiType
flag is now required to opt into handling different node types in a single node view. It used to be the default, but this tripped too many people up.
Bug fixes
Make splitBlock
smart enough to split blocks when the cursor is inside a nested inline node.
Bug fixes
Allow Transform.join
to clear incompatible inline content from the node after the join.
Bug fixes
joinBackward
will, when moving a node into a block, no longer join that block with the block after when the two have compatible content but aren't of the same type.
Fix an issue in splitBlock
that caused it to return true without doing anything when the schema makes splitting at the cursor impossible.
Support implicit conversion between hard break nodes and newlines in the joinForward
and joinBackward
commands.
Bug fixes
Fix an issue where a deleteRange
heuristic could produce unexpected deletion shapes.
Make Transform.join
convert between newlines and line break replacement nodes when necessary.
New features
The new NodeType.isInGroup
method can be used to query group membership.
Bug fixes
Fix a type error caused by use of an older markdown-it type package.
Bug fixes
Fix an issue that would, during some types of document updates, leave the document DOM in an improper form.
Handle the case where drag-selecting in Firefox creates a selection with multiple distinct ranges.
Bug fixes
Fix pasting in Chrome with the require-trusted-types-for CSP enabled.
Fix an issue where, for some kinds of IME on Windows, pressing Enter while in a composition would execute the resulting command on the wrong selection, erasing some typed content.
Bug fixes
Fix null dereferences caused by the behavior of Chrome's newly supported caretPositionFromPoint
method.
Fix an issue where on Android, with GBoard, enter presses in code blocks while a spell correction was selected didn't insert a new line.
New features
The DecorationGroup
interface now has a forEachSet
method to iterate though the contained decoration sets.
Bug fixes
Delete the selection on composition start when on a mark boundary to force Chrome to apply the correct style to the composition.
When the browser starts a composition and the selection spans across blocks, start by clearing it to make sure the composed text node lands in a valid position.
Bug fixes
Make the type of the fullMenu
option MenuElement[][]
instead of MenuItem[][]
.
New features
setBlockType
can now take a function that computes attributes for the new nodes, instead of a static attribute object.
Bug fixes
Prevent triple clicks and clicks on atom nodes from dispatching a selection update when the new selection is equal to the current selection.
Don't crash when window.getSelection()
returns null.
Create a cursor wrapper when starting a composition with a selection that spans mark boundaries, to avoid odd DOM forms created by Chrome in such a situation.
Bug fixes
Fix some corner cases in the way the DOM parser tracks active marks.
Bug fixes
Fix an issue where joinBackward
couldn't lift the block with the cursor when the block before it was isolating.
New features
toggleMark
now takes an option that controls its behavior when only part of the selection has the mark already.
The function given to splitBlockAs
now has access to the split position via a third parameter.
toggleMark
now takes an enterInlineAtoms
option that controls whether it descends into atom nodes.
Bug fixes
Make attribute validation messages more informative.
Bug fixes
Fix an issue where dragging an image on Chrome versions before 121 failed to put the image file in the clipboard data.
Enable cross-site scripting protection hack when rendering nodes and marks inside the editor.
Bug fixes
Add code to DOMSerializer
that rejects DOM output specs when they originate from attribute values, to protect against XSS attacks that use corrupt attribute input.
New features
Attribute specs now support a validate
property that can be used to provide a validation function for the attribute, to guard against corrupt JSON input.
Bug fixes
Add attribute type validation for headings, images, and link marks.
Bug fixes
Add attribute type validation for ordered list nodes.
Bug fixes
Fix an issue where mark steps could cause the history to treat otherwise adjacent changes as non-adjacent, and start superfluous new undo events.
Bug fixes
Fix an issue where parse rules for CSS properties that were shorthands for a number of more detailed properties weren't matching properly.
Bug fixes
Make sure resolved positions (and thus the document and schema hanging off them) don't get kept in the cache when their document can be garbage-collected.
Bug fixes
When composition happens with the cursor between two text nodes, use the last mutated one to guess which one is being changed.
New features
The new splitListItemKeepMarks
command can be used like splitListItem
but will keep the active marks from the original item.
Bug fixes
Improve performance and accuracy of DOMParser
style matching by using the DOM's own style
object.
Bug fixes
Ignore stray <br>
nodes added to parent list elements when backspacing near uneditable content in Firefox.
Fix a crash where the editor tried to call removeAttribute
on a text node.
Fix an issue where coordinates near nested blocks could inappropriately be assigned to be inside those blocks.
Bug fixes
Fix the type of MarkdownParser.parse
to be non-nullable. Add a strict option to MarkdownSerializer
New features
The new strict
option to MarkdownSerializer
makes it possible to make the serializer ignore node and mark types it doesn't know.
New features
The new linebreakReplacement
property on node specs makes it possible to configure a node type that setBlockType
will convert to and from line breaks when appropriate.
Bug fixes
Fix an issue in ReplaceAroundStep.map
that broke mapping steps that wrapped content over steps that inserted content at the start of the step.
New features
setBlockMarkup
now uses the linebreak equivalent node defined in the schema.
Bug fixes
Make sure the content slice stored for an in-editor drag is the one that was transformed by transformCopied
.
Bug fixes
Fix a regression in composition handling in 1.33.3 that occurs for some IMEs when starting composition on an empty line.
New features
The ParseRule
type is now a union of TagParseRule
and StyleParseRule
, with more specific types being used when appropriate.
Bug fixes
When available, use Selection.getComposedRanges
on Safari to find the selection inside a shadow DOM.
Bug fixes
Further improve preserving of compositions for IME systems that keep the cursor before the composed text.
Bug fixes
Improve Android backspace detection when the native effect is to delete an entire block element.
Fix a bug where reconfiguring node views caused the editor to lose focus.
Fix an issue where some commands didn't properly scroll the cursor into view on Mobile Safari.
Fix a bug where starting a composition with stored marks or after a noninclusive mark, with an IME that keeps the cursor at the start of the composed text (like many Chinese IMEs) disrupted composition on Chrome.
Fix a memory leak where a (single) destroyed editor could be kept alive through a reused Range
object.
New features
Add undoNoScroll
/redoNoScroll
commands.
Bug fixes
Fix a type error in the published type declarations in 1.33.0.
New features
The DecorationSource.forChild
method is now public.
New features
Input rules now take an inCode
option that controls whether they should apply inside nodes marked as code.
Bug fixes
Fix a regression that caused widget decorations directly after a node to not get drawn in some situations.
Bug fixes
Make textBetween
emit block separators for empty textblocks.
Bug fixes
Block-level markup inside a heading is no longer escaped by the serializer.
Do not backslash-escape a +
at the start of line when it isn't followed by a space. Upgrade to markdown-it 14
New features
MarkdownSerializerState.renderInline
now takes a parameter that controls whether block-level markup should be escaped.
Upgrade to markdown-it version 14, which provides ES modules.
Bug fixes
Fix a bug that could cause view updates to crash in rare situations where inline nodes were added around decorations.
Bug fixes
Fix a bug in DecorationSet.map
that, in specific cases when mapping through groups of changes, move decorations to the wrong position.
New features
Input rules can now be set to be non-undoable, preventing undoInputRule
from rolling them back.
Bug fixes
Fix a case where a DOM change involving astal characters could create odd steps that started and ended in the middle of UTF16 surrogate pairs.
Dragging a draggable node will no longer implicitly select it.
Bug fixes
Fix a bug where, in some situations, pasting plain text pasted HTML markup.
Bug fixes
Check for text/uri-list data on the clipboard or in the drop event when pasting or dropping content, since some types of copying on Apple devices use this format.
Bug fixes
Work around a Chrome issue where it didn't draw a selection for inline leaf nodes when selecting across them.
Override the native behavior when shift-selecting horizontally across non-text inline nodes, since most browsers behave poorly here.
New features
The new DocAttrStep
can be used to set attributes on the document's top node.
Transform.setDocAttribute
can be used to create a DocAttrStep
in a transform.
Bug fixes
Work around an issue on Chrome where, when clicking above the right side of an uneditable node, the cursor would be put after the node.
Fix a bug that could corrupt the composition when it occurs next to text identical to the composed characters.
New features
The new EditorView.updateRoot
method can be used to make the editor update its DOM root when it is moved to a new document or shadow tree.
Bug fixes
Fix a bug that broke arrow motion near uneditable nodes on Chrome in some situations.
Fix an issue that broke backspace at the end of a textblock that ended in a newline on Chrome.
Fix a crash in the way inline decorations that ended right after a node end position were drawn.
Bug fixes
Fix a failure in replaceRange
to drop wrapper nodes when the same wrapper is already present.
Bug fixes
Fix a bug where icon creation crashed because it couldn't find a Document value.
Bug fixes
Don't directly use the global window
/document
, to fix use in a different frame or shadow root.
Bug fixes
Fix some unnecessary escapes for period characters in Markdown serialization.
Only escape #
signs if they would otherwise create a heading. Add a test for headings in list items
Fix a bug in MarkdownSerializer
that broken expelling of whitespace from marks when the mark spanned multiple nodes.
Bug fixes
When using setBlockType
to convert a code block to a type of node that doesn't contain code, replace newlines with spaces.
Bug fixes
Fix a bug where, when a compositionend event was received before the composition's final changes were processed, the resulting transaction didn't have its composition metadata set.
Fix an issue that caused cursor motion to stop at uneditable nodes that aren't widget decorations.
When scrolling an element higher than the viewport into view, make sure its top is visible.
Bug fixes
Fix a bug that caused posAtCoords
to return incorrect results for coordinates over inline-decorated text.
Don't try to scroll fixed-positioned elements into view by scrolling their parent elements.
Bug fixes
Don't apply style parse rules for nodes that are skipped by other parse rules.
Bug fixes
Allow any blocks as first child of list items to align with what Markdown itself does.
Add parse rules that clear strong
and em
marks when inline CSS resets it.
Bug fixes
Fix a bug where the editor accidentally blocked shift-delete when the whole document is selected.
Bring back workaround for an issue where Firefox draws the cursor in the wrong place in a code block.
Fix an issue where Shift-Insert pastes pasted plain text (because Shift was being held).
Fix an issue where selecting across paragraph and starting a composition would update the state as if Enter was pressed and disrupt the composition.
Bug fixes
Fix a bug in canSplit
that made it interpret the typesAfter
argument incorrectly on splits of depth greater than 1.
New features
splitListItem
now takes an optional second argument to set the attributes of the new list item node. Rename parameter
Bug fixes
Make sure destroy
is called on node views that are replaced by changing a node's markup.
Bug fixes
Allow parse rules with a clearMark
directive to clear marks that have already been applied.
Bug fixes
Fix the types of Fragment.desendants
to include the index parameter to the callback. Add release note
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Fix an issue that could cause the clipboard parser to create invalid slices when parsing content containing isolating nodes.
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Make sure blank lines at the end of code blocks are properly serialized.
Convert soft breaks (single newlines) in Markdown to spaces, rather than newlines in the ProseMirror document, because newlines tend to behave awkwardly in the editor.
Fix a bug that cause the object passed as configuration to MarkdownSerializer
to be mutated. Add release note
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
New features
A new option to MarkdownSerializer
allows client code to configure which node type should be treated as hard breaks during mark serialization. Remove the extra left bracket
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Make the return type of `builders` include properties for schema node/mark names.
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Include CommonJS type declarations in the package to please new TypeScript resolution settings.
Bug fixes
Fix a bug that broke backspace after empty lines in code blocks on Firefox.
Make it possible for the attributes
prop to override the translate
attribute.
Bug fixes
Fix a bug that could cause a view crash on some kind of document updates.
Bug fixes
Fix an issue where, when the browser failed to return a cursor for a set of coordinates (as in a shadow root in Chrome) the library's own algorithm worked poorly for coordinates between lines in a textblock.
Improve performance of changing a parent node (by type or attributes) without modifying its children by reusing the DOM of the child nodes.
Fix an issue where, in right-to-left context, the left and right arrow keys could get stuck on a selectable leaf node because the editor was moving the selection in the wrong direction.
Fix a regression in coordsAtPos
when querying the position of a line wrap.
New features
Attach a "composition"
meta field to transactions generated from DOM changes.
Bug fixes
Fix an issue where, if a composition moved the selection, it might get split across multiple undo events.
New features
If the color
option is set to false
, the library will not assign an explicit color to the cursor.
Bug fixes
Fix an issue where posAtCoords
could incorrectly return positions outside of a table when querying a coordinate inside it.
Update the type of the getPos
callback to include undefined in its return type. Update broken link (ViewProps -> EditorProps) Also detect iOS enter when the new block type is a less common node
Fix an issue where Enter on iOS would sometimes not be handled by the library.
Bug fixes
Don't hide the drop cursor when no valid drop point can be found below the pointer.
Bug fixes
Fix joinTextblockBackward
not applying when the textblock before was wrapped in another node.
Bug fixes
Work around macOS putting the unmodified character in KeyboardEvent.key
when Cmd is held down, fixing shift-cmd-letter bindings.
New features
The drop cursor element now has a prosemirror-blockcursor-block
/inline
CSS class depending on whether it is in a block or inline position.
Bug fixes
Fix a bug that caused posAtCoords
to always return the position after a leaf node when querying a position on top of the node's element.
Fix an issue where, when putting focus on the editor by clicking at the very start of the document, the editor would restore a previous selection.
Bug fixes
Keep content in isolating nodes inside their parent when fitting a replace step.
Transform.setNodeMarkup
will no longer clear the node's marks when it isn't given an array of marks.
New features
EditorView
now has pasteHTML
and pasteText
methods which initiate paste handling.
New features
Parse rules for styles can now provide a clearMark
property to remove pending marks (for example for font-style: normal
).
Bug fixes
Add parse rules to clear em
and strong
marks for styles that reset font style/weight.
Bug fixes
Make sure enter key handlers are called on Chrome Android when the cursor is in a position where the native behavior of Enter doesn't change the document.
Fix a crash that could occur when starting a composition at the end of a non-inclusive mark.
Fix a bug in (vertical) endOfTextblock
that caused it to return falsely positive results inside textblocks that had a separate contentDOM
.
New features
The new splitBlockAs
command-builder allows you to pass in custom logic to determine the type of block that should be split off.
Bug fixes
Make setBlockType
act on all selection ranges in selections that have them.
New features
The new joinTextblockForward
and joinTextblockBackward
commands provide a more primitive command for delete/backspace behavior when you don't want the extra strategies implemented by joinForward
/joinBackward
.
Bug fixes
Copy all properties from the input spec to Schema.spec
.
Bug fixes
Improve DOM parsing of nested block elements mixing block and inline children.
Bug fixes
Fix a problem when returning decorations from an outer editor from the decorations
prop.
Bug fixes
Don't treat the empty string the same as null
in wrapBlock
's firstDelim
argument. Check content of code blocks for any sequence of backticks
Use longer sequences of backticks when serializing a code block that contains three or more backticks in a row.
Bug fixes
Fix a crash when there's no DOM for the node next to the drag position.
Bug fixes
Make sure the this
bindings in editor props defined as part of a plugin spec refers to the proper plugin type.
Bug fixes
Fix an issue where HTML comments added to the clipboard by the OS throw off the clipboard parser.
Make sure Chrome Android's native behavior on pressing Enter in an empty nested list item is replaced by the result of the editor's Enter key handler.
New features
The transformPastedHTML
, transformPastedText
, transformPasted
, transformCopied
, and clipboardTextSerializer
props are now passed the view instance as last argument.
Bug fixes
Work around the five-year-old Safari bug where it won't accurately report the selection inside shadow roots, which would break ProseMirror when put in shadow DOM.
New features
You can now pass an optional markdown-it environment object to .
Bug fixes
Avoid a crash in selection updates in a hidden editor on Safari.
Bug fixes
Fix an issue where the editor would reset its scroll position to the top of the document for any state reconfiguration, even if the document was unchanged.
Bug fixes
Fix an issue where the editor wouldn't realize it was focused on IE when IE's resize controls are on an element inside the content.
New features
The new transformCopied
prop can be used to transform a copied/cut slice before it is serialized to the clipboard.
Bug fixes
Fix an issue where liftListItem
could create adjacent sublists when lifting an item with sub-items.
Bug fixes
Make sure toggleMark
doesn't add marks to top nodes with non-inline content.
Bug fixes
Fix an issue where DecorationSet.map
, given a mapping with multiple steps, could in some cases corrupt the decorations.
Stop calling handleClick
when the mouse moved but failed to fire mousemove events (for example when dragging a scrollbar).
Bug fixes
Don't escape colon characters at the start of a line.
Escape parentheses in images and links.
Allow links to wrap emphasis markers when serializing Markdown.
New features
The new AttrStep
(and Transform.setNodeAttribute
) can be used to set individual attributes on a node.
AddNodeMarkStep
and RemoveNodeMarkStep
can now be used to add and remove marks on individual nodes. Transform.addNodeMark
/removeNodeMark
provide an interface to these in transform objects.
Bug fixes
Fix a bug in DecorationSet.map
that could cause invalid mapping when step maps contain multiple replaced ranges.
Make sure that when the editor receives focus via tab or calling .focus()
on its DOM element, the existing selection is restored.
Avoid collapsing of whitespace in Firefox when the editor doesn't have white-space
set to pre-wrap
.
New features
disableDropCursor
is now passed the dragover event as 3rd argument.
Bug fixes
Fix a bug that in some situations caused composition to be disrupted on Chrome due to a workaround for another browser issue activating inappropriately.
New features
EditorProps
now takes an optional type parameter that indicates the type of this
in prop functions.
Bug fixes
Fix a regression where lifting a nested list could crash.
Bug fixes
Fix an issue where a composition happening at the same time as widget insertion/removal could corrupt the rendered DOM.
Fix a problem where coordsAtPos
would look inside the DOM for atomic nodes, and sometimes return very odd positions that way.
Bug fixes
Make sure '!' characters in front of links are escaped.
Bug fixes
Avoid spurious type errors on handleDOMEvents
by widening the type for unknown event objects.
Bug fixes
Don't escape characters in autolinks.
Fix a bug that caused the serializer to not escape start-of-line markup when inside a list.
Bug fixes
Work around a Safari bug where mutation records get delivered even though the observer wasn't observing when the mutations happened.
Bug fixes
Make the SelectionRange
constructor public in the types.
Bug fixes
Mark prosemirror.css as having side effects in package.json.
Bug fixes
Export CSS file from package.json.
Bug fixes
Export CSS file from package.json.
Bug fixes
Upgrade to orderedmap 2.0.0 to avoid around a TypeScript compilation issue.
Bug fixes
Fix incorrect types for handleDrop
and decorations
. Document open properties on widget specs
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
New features
Export the NodeViewConstructor
and MarkViewConstructor
types. Include Node/MarkViewConstructor in doc template
Bug fixes
Export CSS file from package.json.
Bug fixes
Fix a bug where inline nodes with content would reset the marks in their parent node during Markdown parsing.
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.
New features
Mark views can now be specified with a separate editor prop, markViews
, to make it easier to get the types right.
Bug fixes
Fix a crash in DOM parsing.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
Bug fixes
Creating a TextSelection
with endpoints that don't point at inline positions now emits a warning. (It is technically an error, but crashing on it might be too disruptive for some existing setups.)
New features
Include TypeScript type declarations.
Bug fixes
Fix a regression that caused the key handler to crash.
Bug fixes
Fix an issue where bogus table wrappers could be added when copy-pasting table content nodes within an editor.
Fix a crash that could occur when two textblocks were joined in the editor DOM.
Treat ctrl-b/f/p/n on macOS similar to arrow key presses, anticipating cursor motion.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
Bug fixes
Fix an issue where the default behavior of history beforeInput events could still go through when the undo history is empty.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
New features
Include TypeScript type declarations.
Bug fixes
Work around a hidden cursor issue in Chrome when a textblock ends in an uneditable node wrapped in a mark.
Bug fixes
Fix an issue where enter on Chrome Android could, in textblock nodes rendered with an inner content element, delete the text after the cursor.
Bug fixes
Make replacements that span to the end of a textblock more consistent with those ending in the middle of the block.
Bug fixes
replaceRange
will now close multiple defining parent nodes when appropriate.
Bug fixes
Fix an issue where a node view with a separate content wrapper node could sometimes lose its content on Chrome when backspacing out content due to unexpected DOM element recreation.
Bug fixes
Make it possible to specify multiple marks of the same type for a given piece of content.
Bug fixes
Fix a crash in DecorationSet.map
that could occur with some kinds of lift transformations.
New features
Node specs can now use the definingForContent
and definingAsContext
properties to opt in to specific parts of the existing defining
behavior.
Bug fixes
Don't override behavior of Home and End keys in base keymap.
New features
MarkdownSerializer
now takes an escapeExtraCharacters
option that can be used to control backslash-escaping behavior. Fix types for new option
Bug fixes
Make sure screen readers don't read the <img>
nodes added as kludge for cursor behavior.
Bug fixes
Fix an issue where the editor needlessly interrupted composition with IME systems that keep the cursor at the start of the composition, such as some Pinyin input methods.
Bug fixes
Fix a crash when a view was being destroyed during input reading.
Fix a crash on Firefox when replacing text in some specific types of document structure.
Bug fixes
Make sure compositions started from a gap cursor have their inline context created in advance, so that they don't get aborted right away.
Bug fixes
Avoid escaping underscores surrounded by word characters.
Bug fixes
Make sure that constructing an empty StepMap
returns StepMap.empty
.
Bug fixes
Fix an issue where joinBackward
and joinForward
would return true when activated with the cursor in an empty but undeletable block, but not make any change.
Bug fixes
Add a workaround for a bug on macOS where Ctrl-a and Ctrl-e getting stuck at the edge of inline nodes.
New features
The new selectTextblockEnd
and selectTextblockStart
commands move the cursor to the start/end of the textblock, when inside one.
Ctrl-a/e on macOS and Home/End on other platforms are now bound to selectTextblockEnd
and selectTextblockStart
.
Bug fixes
Fix an issue that could cause pieces of DOM to not be synchronized with the document after some kind of changes around marks.
Fix a bug where marks rendered with nested elements would in some situations suppress new input.
Disable Chrome-specific drag-selection workaround in non-Chrome browsers because it affected table cell selection in Safari.
New features
Upgrade markdown-it to version 12.
Bug fixes
Fix a bug where URL text in links and images was overzealously escaped.
Bug fixes
Fix a bug in the way whitespace-preservation options were handled in DOMParser
.
New features
A new NodeSpec
property, whitespace
, allows more control over the way whitespace in the content of the node is parsed.
Bug fixes
Use the whitespace
node prop where appropriate.
Bug fixes
Improve the way the editor handles the mess of events produced when pressing Enter before a word that was just typed on Chrome + GBoard.
Fix an issue where compositions right before another instance of the composed text could cause the editor to crash.
Fix an issue where, if decorations changed during a pointer drag selection, the selection anchor might move around inappropriately.
Bug fixes
Fix an issue where a gap cursor would fail to show up at the start or end of some isolating nodes.
Bug fixes
Fix a bug where MarkdownParser.parse
could return null when the parsed content doesn't fit the schema.
Make sure underscores are escaped when serializing to Markdown.
Bug fixes
The clipboard parser will no longer drop trailing <br>
nodes that appear in an inline parent element.
Bug fixes
Avoid some unnecessary node redraws when marks are present in sibling nodes.
Bug fixes
Restore accidentally reduced lookahead distance in view updating algorithm.
Bug fixes
When parsing clipboard content, ignore trailing BR nodes that look like they might be there as a contenteditable kludge.
New features
EditorView
now exposes an isDestroyed
property that can be used to test if the view has been destroyed.
New features
Add support for a disableDropCursor
property on node specs, which can be used to turn off the drop cursor inside such nodes.
Bug fixes
Fix an issue where some types of node decoration changes could cause an unnecessary cascade of node redraws.
New features
Widget decorations now accept a destroy
option, which will be called when the widget is removed from the view.
Bug fixes
Fix issue where recent Mobile Safari versions weren't treated as Mac platforms.
New features
Multiple style
properties provided through the attributes
prop are now merged. Adjust mac detection for recent changes to navigator.platform on iOS
Bug fixes
Fix issue where iPhones and iPads with a hardware keyboard didn't have Mod converted to Cmd.
Bug fixes
Fix issue where the default PC keymap was used on recent versions of iPhone or iPad operating systems.
New features
textBetween
now allows its leaf text argument to be a function.
Bug fixes
Go back to regular dependencies, so that the package works on NPM <7.
Bug fixes
Stop removing leading/trailing whitespace from pasted plain text.
Fix an issue that could cause invalid content to be produced when pasting HTML with isolating nodes in it.
Bug fixes
Fix a crash when pasting whitespace-only content as text.
Bug fixes
Add a binding for Shift-Backspace to the base keymap, so that shift or caps-lock won't interfere with backspace behavior.
Fix an issue in autoJoin
that made it ignore a third argument if it was passed one.
Bug fixes
Fix an inconsistency in deleteRange
where it would delete the parent node for ranges covering all textblocks in a given parent.
Bug fixes
Fix a crash in liftListItem
that happens when list items that can't be merged are lifted together.
New features
MarkdownParser.tokenizer
is now public, for easier creation of parsers that base on other parsers.
New features
The GapCursor
constructor is now public.
Bug fixes
The library accidentally allowed node decorations on text nodes. It no longer does.
Fix an issue on Chrome and Safari where coordinates for positions between uneditable nodes and the end of a textblock would return zero-height rectangles.
Fix a bug where vertical endOfTextblock
queries could inappropriately return true when a small line height is used.
New features
It is now possible to pass plugins directly to the view with the plugins
direct prop.
Bug fixes
Serializing to Markdown now properly escapes '>' characters at the start of the line.
Bug fixes
Fix an issue where generic styles for elements could cause separator nodes created by the editor to impact layout.
Fix an issue where moving to another tab and back could clear a node selection.
Bug fixes
Avoid some bugs around drag-selecting by delaying synchronization between the DOM and the state selection until the end of the drag.
Bug fixes
Fix a bug that caused the beforeInput
handler to not actually invoke the history commands properly.
New features
The history plugin now listens for beforeInput
events with historyUndo
or historyRedo
type, and applies the undo/redo commands when they occur.
Bug fixes
Fix another issue around copy-pasting table structure, causing inappropriate opening of copied cell selections.
Bug fixes
Add a DOM attribute to the content element to avoid automatic translation services from messing with the editable text.
Fix a bug where copy-pasting table content sometimes carried along superfluous table markup.
Fix issue where end-of-textblock detection didn't use the correct selection when in a shadow root.
New features
The DecorationSource
interface now exposes a map
method. Add a translate=no attribute to the editor element by default
Bug fixes
DOMSerializer.serializeNode
will no longer ignore the node's marks.
Bug fixes
Work around an issue where Chrome and Safari will replace some spaces with non-breaking spaces when putting HTML on the clipboard.
When pasting as plain text (shift-mod-v) apply the marks at the selection to the inserted content.
Fix flaky behavior when starting a composition with a selection that spans multiple blocks.
Bug fixes
Fix an issue where dragging from just outside a draggable node on Chrome would cause odd dragging behavior.
Bug fixes
Fix a bug in the previous release where handleClickOn
wasn't fired anymore for clicks with the middle or right mouse button.
Bug fixes
Fix an issue where splitListItem
would delete content when activated in a sublist that had content directly after it.
Bug fixes
Make joinBackward
capable of joining textblocks wrapped in parent nodes when the parent nodes themselves can't be joined (for example two list items which allow only a single paragraph).
Bug fixes
Work around a Safari bug where it draws the cursor at the start of the line when it is after an uneditable node at the end of the line.
Fix an issue where the DOM could get out of sync when editing decorated text.
Work around an issue where Firefox draws the cursor on the wrong line when after a newline.
Fix a bug where double-clicking with the left mouse button and then pressing another mouse button was treated as a triple click.
Bug fixes
Be less agressive about dropping whitespace when the context isn't know in DOMParser.parseSlice
.
Bug fixes
Fix a regression where splitBlock
could crash when splitting at the end of a non-default block.
Bug fixes
Avoid a crash that happened when the document shrank during dragging.
Bug fixes
Fix a crash in splitBlock
that occurred with certain types of schemas.
Bug fixes
Fix a bug where clicking on a textblock that had a node-selected parent didn't set a cursor selection.
Fix a bug that caused a workaround for a Chrome Android issue to not work correctly, leading to bad cursor placement after some types of text input.
Bug fixes
Fix a crash in mouse click handling introduced in the previous version.
Bug fixes
Work around a Firefox bug where backspace sometimes deletes the node after the cursor.
Fix a bug that prevented transformPasted
hooks from being called on content dragged within the editor.
Fixes an issue where clicking near a node or other special selection on Chrome would in some cases do nothing.
Bug fixes
Fix incorrect drag cursor in Chrome on some platforms.
Fix an issue where a race condition could leave a node uneditable when clicked.
Fix scroll handling when the editor is placed through a DOM component slot.
Fix a typo in the Chrome backspace workaround.
Fixes an issue where, when mouseup events weren't being delivered, the editor could leak event handlers.
Bug fixes
Treat ProseMirror libraries as peer dependencies, to avoid duplicate libraries when using this.
Bug fixes
DOM parsing with preserveWhitespace: "full"
will no longer ignore whitespace-only nodes.
Bug fixes
Fix an issue where, when pressing enter or space at the start of a composition, the cursor would jump to the end of the composition on Chrome Android.
Fix an issue that would cause Enter presses to be dropped on Android when in a node whose DOM representation nested more than one element.
Fix a bug where pasting specific types of HTML could cause a crash.
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.
Bug fixes
Fix a regression in dropPoint
that caused it to dereference undefined in some circumstances.
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.
Bug fixes
Hide the drop cursor when dropPoint
doesn't return a position.
New features
The various properties of subclasses of Step
(ReplaceStep
, ReplaceAroundStep
, AddMarkStep
, and RemoveMarkStep
) are now part of the public interface.
Bug fixes
Properly handle CSS class name strings with extra spaces in decorations.
Fix a performance bug when updating nodes with thousands of children.
Bug fixes
Fix the scrolling-into-view logic in the case where a scale transformation is applied to the editor. Strip carriage return chars from text pasted as code
Remove carriage return characters when pasting text into code blocks.
Bug fixes
Fix a crash in posAtDOM
.
New features
Node view constructors and update
methods are now passed the inner decorations of the node.
Bug fixes
Fix an issue where some user actions (such as enter on iOS) in a node whose content DOM element isn't it's top element could leave the DOM in a damaged state.
Bug fixes
Fix an issue where the ProseMirror-hideselection
element class would be briefly removed and then restored when moving from one invisible selection to another.
Fix an issue where the cursor could end up on the wrong side of a widget with side
< 0.
Bug fixes
Fix a regression where createParagraphNear
no longer fired for gap cursor selections.
Bug fixes
Fix a bug where merging replace steps with the structure
flag could create steps that couldn't be applied.
Bug fixes
Fix an issue where using the vertical arrow keys after select-all didn't update the selection.
Bug fixes
Improve behavior of enter when the entire document is selected.
Bug fixes
Fix an issue in Transform.removeMark
where the mark type was passed through to be removed instead of the mark itself.
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.
Bug fixes
Fix an issue where the view could go into an endless DOM flush loop in specific circumstances involving asynchronous DOM mutation.
Bug fixes
Fix an issue where nested tags that match mark parser rules could cause the parser to apply marks in invalid places.
Bug fixes
MarkType.removeFromSet
now removes all instances of the mark, not just the first one.
Bug fixes
Add another kludge to work around an issue where Firefox displays the cursor in the wrong place in code blocks.
Fix a bug where validation of decorations passed to DecorationSet.add
sometimes passed the wrong offsets to the validator.
Fix bad selection position in empty textblocks. Solves several issues with editing in Firefox Android.
Bug fixes
Fix drop cursor positioning when the editor's offsetParent
has been scrolled.
Bug fixes
Fix a bug where adding invalid decorations (for example zero-length inline decorations) with DecorationSet.add
would fail to drop those.
Bug fixes
Remove (broken, poorly conceptualized) schema
option to EditorState.reconfigure
.
Bug fixes
Fix an issue where AddMarkStep
would mark inline nodes with content.
Bug fixes
joinBackward
and joinForward
will now, when the textblock after the cut can't be moved into the structure before the cut, try to just join the inline content onto the last child in the structure before the cut.
toggleMark
will now skip whitespace at the start and end of the selection when adding a mark.
Bug fixes
The library will now always let the browser perform its native pasting behavior when the clipboard data is empty and no paste handler handles the event.
Fix a bug where domAtPos
(and thus cursor placement) would pick positions inside uneditable DOM or atom nodes.
Bug fixes
Fix a regression in coordsAtPos
when used on an empty line at the end of a code block.
Bug fixes
Fix an issue where starting a composition with stored marks would sometimes create the wrong steps (and thus break the mark) on Chrome.
New features
EditorView.domAtPos
now takes a second parameter that can be used to control whether it should enter DOM nodes on the side of the given position.
Bug fixes
The Markdown parser will now correctly set the tight
attribute on list nodes.
Bug fixes
Fix a bug where nested marks of the same type would be applied to the wrong node when parsing from DOM.
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.
Bug fixes
Fix platform detection on recent iPadOS versions, restoring several workarounds for bugs that were accidentally turned off there.
Bug fixes
Fix an issue where the cursor ended up in the wrong place when pressing enter in an empty heading on iOS.
Bug fixes
Fix an issue where pressing enter at the start of a line in a code block would leave the visible cursor in the wrong place on Firefox.
Bug fixes
Fix a bug where overlapping inline decorations would get drawn incorrectly (and even corrupt the drawing of unrelated content).
Bug fixes
Fix an issue where the attributes of defining nodes were dropped when copying to the clipboard.
New features
The output of toDOM
functions can now be a {dom, contentDOM}
object specifying the precise parent and content DOM elements.
Bug fixes
Fix an issue where a drag starting briefly after an aborted drag could confuse the view and break the second drag. Allow callers of coordsAtPos to specify a side
New features
EditorView.coordsAtPos
now takes a side
argument that determines which side of the position to look, if ambiguous.
Bug fixes
Fix crash when undoing input rules when the rule was triggered without inserting text.
Bug fixes
Fix issue where 1.11.1 uses an array method not available on Internet Explorer.
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.
Bug fixes
Fix an issue where, when inserting <br>
nodes, Safari would briefly show the cursor before the inserted break, though the DOM selection had already been set after it.
When dragging inside the editor, whether the operation copies or moves is now determined by the modifiers held on drop, not on drag start.
Bug fixes
Fix issue where the DOM selection could end up in an invalid state after a keyboard cursor motion event that had no effect.
Fix an issue where some types of drop events would fail to select the dropped content.
Work around Safari issues when pressing shift-down with the cursor before an uneditable element.
Bug fixes
Fix an issue where mapping a decoration set could corrupt the decoration positions in specific cases.
Bug fixes
Fix a crash that occurred when inline decorations covered inline nodes that weren't leaf nodes.
Bug fixes
Fix an issue where fitting a slice at the top level of the document would, in some circumstances, crash.
Bug fixes
Work around a Firefox issue where the cursor is sometimes shown in the wrong place when directly after a <br>
node.
The editor will now reset composition when stored marks are set on the state, so that the marks can be added to the next input.
Inline decorations are no longer applied to inline nodes that aren't leaves, only to the innermost layer.
Bug fixes
Fix a regression where liftListItem
couldn't lift a paragraph from the end of a composite list item.
Bug fixes
Fix an issue where splitListItem
could delete other content in the item when pressing enter in an empty paragraph that had other content below it in a list item.
New features
Markdown parse specs can now be specified as noCloseToken
, which will cause the parser to treat them as a single token, rather than a pair of _open
/_close
tokens.
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.
Bug fixes
Adjust the workaround for Chrome's DOM selection corruption bug to cover more cases.
Bug fixes
Work around another issue where Chrome misreports the DOM selection.
New features
Resolved positions have a new convenience method, posAtIndex
, which can resolve a depth and index to a position.
Bug fixes
Fix a bug that prevented non-canonical list structure from being normalized.
Bug fixes
Fix an issue where Enter on iOS might be handled twice on slow devices. Pass plain text flag to transformPastedText and clipboardTextParser props
Fix a bug where typing in front of a mark could in some circumstances cause the editor to discard the new content.
New features
The transformPastedText
and clipboardTextParser
props now receive an extra argument, plain
, indicating whether the paste was forced as plain text.
Bug fixes
Fix an issue where creating a replace step would sometimes fail due to unmatchable close tokens after the replaced range.
Bug fixes
Fix a bug where storing DOM nodes directly in widget decorations (not recommended) could cause the view to try and place the same DOM node multiple times.
Bug fixes
Fix a crash when the editor tries to read a DOM selection outside of itself.
Improve the way inline decorations covering non-leaf inline nodes are rendered. Ensure elt is defined before accessing it in posAtCoords
Fix a crash in Safari when the browser's elementFromPoint
returns null in posAtCoords
. Handle case where Chrome flips the nesting order of edited inline nodes
Fix the issue of <a>
marks on decorated text being lost during editing because Chrome changes the nesting order of the link and the decoration <span>
element in the DOM.
Fix an issue where, when pressing enter with a bolded virtual keyboard suggestion on Android's Gboard, the cursor would stay on the wrong line.
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.
Bug fixes
Fix bug in the way the editor handles Cmd-arrow presses on macOS.
Bug fixes
Fix an issue where the editor would override behavior for Cmd-arrow key presses on macOS the wrong way in some situations.
Fix handling of copy and paste in IE when top-level elements can't be focused.
Bug fixes
Fall through to the name associated with a key's keyCode
when the character produced isn't ASCII and isn't directly bound.
Bug fixes
Don't allow hard_break nodes in headings.
Bug fixes
Fix a crash on IE, which sets document.activeElement
to null in some circumstances.
Bug fixes
Work around an issue in Safari where you couldn't click inside a selected element to put the cursor there.
Fix enter at start of paragraph in iOS inserting two new paragraphs.
Scrolling the cursor into view now makes sure it doesn't end up below a scrollbar.
Bug fixes
Fix a crash on Chrome during selection updates when Selection.collapse
inexplicably leaves the selection empty. Update documented type for handlePaste event arg
Fix another issue that could break decoration set mapping in deeply nested nodes.
Bug fixes
Rewrite the slice-fitting code used by replaceStep
to handle a few more corner cases.
Bug fixes
selectNodeForward
and selectNodeBackward
will now also select nodes next to a gap cursor (or other custom empty selection type).
Bug fixes
Fix an issue where the gap cursor plugin would sometimes cause perfectly selectable content to be skipped when moving the selection with the arrow keys.
Bug fixes
Fix superfluous cursor showing up in Chrome when there is a gap cursor or similar custom empty selection active.
Fix an issue where DecorationSet.remove
would ignore the positions of its argument decorations, and only compare by type.
Bug fixes
Work around Chrome Android issue where pasting would close the virtual keyboard.
Fix an issue where some kinds of changes would cause nodes to show up twice in the DOM.
Bug fixes
Improve behavior around unselectable block nodes.
Bug fixes
When deleting a whole-document-selection causes default content to be generated, make sure the selection is moved to the start of the document.
Bug fixes
Improve return values from coordsAtPos
on line breaks in Safari and Firefox.
Make sure enter on iOS is handled even when the native behavior has no effect.
Bug fixes
Fix mismatch between DOM and state selection bug at compositionend in IE11.
Make sure handleDrop
](https://prosemirror.net/docs/ref/#view.EditorProps.handleDrop) is called even when there's nothing on the clipboard.
Fix a bug where reconfiguring a view in a way that changed both the active node views and the attributes of the top node left the old attributes active.
Work around another case where Chrome lies to the script about its current DOM selection state.
Avoid redrawing nodes when both their content and a widget in front of them is updated in the same transaction.
Fix issue where scrolling with multiple scrollable containers sometimes moves to the wrong position.
Bug fixes
Restore compatibility with IE11.
Bug fixes
Fix joinPoint
to return check whether the parent node allows a given join.
Bug fixes
Update crel dependency to a version that exposes an ES module.
Bug fixes
Fix bug when starting a composition after a link, when the composition started with the character that ended the link.
Bug fixes
Fix issue where scrolling the cursor into view in a scrollable editor would sometimes inappropriately scroll an outer container as well.
Bug fixes
Fix parsing of tbody
, tfoot
, and caption
elements in pasted HTML content. Fix bug in selection-is-at-edge check
Fix an issue where moving focus to the editor with the keyboard or the DOM focus
method would leave the DOM and state selections inconsistent.
New features
Widget decorations can now take an ignoreSelection
option, that causes the editor to leave selections inside them alone.
Bug fixes
Fix an issue that could lead to the editor making regular content uneditable on Safari.
Bug fixes
Fix a crash on Firefox when starting a composition after a marked non-text node.
Bug fixes
Make sure to reset the selection when the browser moves it into an uneditable node.
Fix issue where the editor would fail to create a meaningful DOM selection for a node selection on Safari.
Makes sure the iOS virtual keyboard gets its internal state (autocorrection, autocapitalization) updated when the user presses enter.
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Fix bug that would sometimes cause widget decorations to be drawn with marks from the node after the text node they were inside of.
Bug fixes
Fix a crash in documents that have a textblock as top node.
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.
New features
The NodeType
method hasRequiredAttrs
is now public.
Element and attribute names in DOMOutputSpec
structures can now contain namespaces.
Bug fixes
Fix an issue where, since version 1.7.4 of prosemirror-model, splitBlock
fails to create the expected new textblock in some schemas.
Bug fixes
Fix issue that broke parsing ordered lists with a starting number other than 1.
Bug fixes
Don't use short-hand angle bracket syntax when outputting self-linking URLs that are relative.
Bug fixes
Fix a bug that caused the DOM to go out of sync with the decorations when updating inline decorations that added multiple wrapping nodes to a piece of content.
Bug fixes
Fix a crash when deleting a list item in Safari while using a parse rule with a context
property for <li>
elements.
Work around another case where Chrome reports an incorrect selection.
Work around issue where Firefox will insert a stray BR node when deleting a text node in some types of DOM structure.
Bug fixes
Fixes a regression where appeneded transactions were combined into the previous history event even if that had been explicitly closed.
Bug fixes
Fix the way decorations update node styles to allow removing CSS custom properties. Link to https in readme and changelog
The root
accessor on views now makes sure that, when it returns a shadow root, that object has a getSelection
method.
Fix an issue where the DOM selection could get out of sync with ProseMirror's selection state in Edge.
Bug fixes
Fix a crash in deleteRange
that occurred when deleting a region that spans to the ends of two nodes at different depths.
Bug fixes
Downgrade a dependency so that the package can run in IE11 again.
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
Rename ES module files to use a .js extension, since Webpack gets confused by .mjs
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
Fix issue where the editor wouldn't update its internal selection when the editor was blurred, its selection was changed programatically, and then the editor was re-focused with its old DOM selection.
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
The file referred to in the package's module
field now is compiled down to ES5.
Bug fixes
Fix an issue where keyboards layouts that use shift to produce characters that are created without shift on a US keyboard would fail to fire bindings for those keys that include the Shift- modifier.
Bug fixes
Fix issue where EditorView.focus
would scroll the top of the document into view on Safari.
Bug fixes
Work around selection jumping that sometimes occurs on Chrome when focusing the editor.
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.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
Bug fixes
Prevents appended transactions from starting a new event group, even if they were created a while after the previous transaction.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
New features
Add a module
field to package json file.
Bug fixes
ContentMatch.edge
now throws, as it is supposed to, when you try to access the edge past the last one.
Bug fixes
Fix issue where paste events were stopped when the clipboard parser failed to make sense of the content.
Fix issue where the handlePaste
prop might be called multiple times for a single paste.
Bug fixes
Set the editable element to use a white-space: break-spaces
style so that whitespace at the end of a line properly moves the cursor to the next line.
Fix issue where posAtCoords
could throw an error in some circumstances on Firefox.
Don't force focus back on the editor if a node view moves focus in its setSelection
method.
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.
Bug fixes
Code blocks in the schema no longer allow marks inside them.
Code blocks are now parsed with preserveWhiteSpace: full
, preventing removal of newline characters.
Bug fixes
Reduce unnecessary redraws when typing creates a new text node on Chrome.
The default prosemirror.css now also turns off ligatures in Edge.
Fix issue where the cursor stays before the typed text in Edge, when typing in an empty paragraph or between hard break nodes.
New features
The mutation records passed to ignoreMutation
now contain the old attribute value.
Bug fixes
Upgrade w3c-keyname package dependency.
Bug fixes
Enabling a mark and then starting a composition, on Chrome Android, will no longer cause the cursor to jump to the start of the composition.
Bug fixes
Fix an issue where fillBefore
would in some cases insert unneccesary optional child nodes in the generated content.
Bug fixes
Fix regression where splitListItem
doesn't work at the end of an item when the content for list items has different first and non-first allowed nodes.
New features
dropCursor
now takes a new option, class
, to set the CSS class name of the cursor element. Add class option to in-code docs
Bug fixes
Fix workaround for broken IE11 DOM change records when inserting between <br>
nodes to handle more cases.
Bug fixes
Don't leave DOM selection in place when it is inside a node view but not inside its content DOM element.
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.
Bug fixes
Fix crash in building replace steps for open-ended slices with complicated node content expressions.
Bug fixes
Fix an IE11 issue where marks would sometimes unexpectedly get dropped when inserting a space after marked text.
Fixes an issue where handleTextInput
wasn't called when typing over a single character with the same character.
Bug fixes
Fix an issue where the DOM node representing a mark could be corrupted when the browser decides to replace it with another node but ProseMirror restored the old node after the change.
Handle another case where typing over a selection in IE11 confused the editor.
Bug fixes
Fix an issue where typing over a decorated piece of text would sometimes just act like deletion.
Fix another problem in IE11 with typing over content, where typing over a decorated bit of text caused a crash.
Bug fixes
Fix issue where typing over the entire contents of an inline node on IE11 would insert the typed content in the wrong position.
Bug fixes
Fix an issue where IE11 would select the entire textblock after deleting content at its start.
New features
View instances now have a public editable
property that indicates whether they are in editable mode.
Bug fixes
Fix crash on IE11 due to using a method that platform doesn't support. Don't show a drop cursor when the view isn't editable
The drop cursor will no longer show up when the view isn't editable.
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.
Bug fixes
Fix a regression in 1.10.2 that broke copying on IE11.
Bug fixes
Fix an issue where posAtCoords
could crash by dereferencing undefined in some circumstances.
Fix inserting text next to a hard break in IE11.
Fix an issue where typing over a selection would result in two different transactions (once for the deletion, once for the insertion) on IE11.
Selecting the word at the start of the document and typing over it no longer causes the text input to appear at the end of the document in IE11.
Bug fixes
Copying content will no longer create elements in the main document, which prevents images from loading just because they appear in clipboard content.
Bug fixes
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.
Bug fixes
Fix an issue that caused the cursor to be scrolled into view when focus()
was called on IE11.
Fix problem where the cursor cycled through pieces of right-to-left text on Firefox during horizontal motion when the gapcursor plugin was enabled.
Fix spurious mutation events in Firefox causing mark replacement at end of composition. Restore call to dom.focus on view.focus
Fix a bug that could cause node views in front of marked nodes to not be destroyed when deleted, and caused confusion in composition handling in some situations.
Cursor wrappers (a kludge to make sure typed text gets wrapping DOM structure corresponding to the current marks) are now created less eagerly, and in a less invasive way, which resolves a number of problems with composition (especially on Safari) and bidirectional text.
New features
Node views can now ignore selection change events through their ignoreMutation
callback.
Bug fixes
Transaction.setSelection
now immediately checks whether the given selection points into the proper document, rather than silently accepting an invalid selection.
Bug fixes
Fix an issue where copying content from a ProseMirror instance into an instance using another schema could, in some circumstances, insert schema-violating content.
Fix comparison of decoration sets, which should solve unneccesary re-renders when updating decorations with an identical but newly allocated set. Don't update DOM selection in uneditable editors when the focus is elsewhere
Fix a bug where the editor would steal focus from child elements when in non-editable mode.
Fix error and corruption in IE11 when backspacing out a single character after a br node.
Bug fixes
Fix a crash posAtCoords
in Firefox when the coordinates are above a text input field.
Bug fixes
Fix an issue where the DOM change handler would treat the parsed content as the wrong part of the document.
Fix an issue in IE11 where deleting the last character in a textblock causes a crash.
Fix an issue where backspacing out the first character in a textblock would cause IE11 to move the selection to some incorrect position.
Bug fixes
Do not show a gap cursor when the view isn't editable.
Bug fixes
Fix a crash in coordsAtPos
caused by use of an incorrect variable name.
Bug fixes
Fix arrowing over unselectable inline nodes in Chrome and Safari, which by default introduce an extra needless cursor position before the node.
Fix a bug that caused DOM changes to be ignored when happening directly in front of some types of DOM events (such as focus/blur).
Bug fixes
Fix a bug that could occur when parsing multiple adjacent pieces of text with the same style.
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.
Bug fixes
Fix an issue where moving focus from a node inside of the editor to the editor itself could sometimes lead to a node selection around the inner node rather than the intended selection (on Chrome).
Bug fixes
Fix an issue where in mapSelectionBackward
mode, the plugin flipped the head and anchor of the selection, leading to selection glitches during collaborative editing.
Bug fixes
ProseMirror will no longer try to stabilize the scroll position during updates on browsers that support scroll anchoring, since it'd inadvertently cancel the browser's behavior.
Fix an issue in Safari where the editor would interrupt the composition spacebar menu because it incorrectly interpreted the mutation events fired by the browser as representing a replacement of the selection with identical text.
Work around an issue where, on Safari, an IME composition started in an empty textblock would vanish when you press enter.
Bug fixes
Fix bug in composition handling when the composition's parent node has an extra wrapper node around its content.
Bug fixes
Fix a null-dereference when running in strict mode.
Bug fixes
Prevent input rules from running during compositions, since they will annoyingly interrupt them.
Bug fixes
Fix regression in handling text editing events on IE11.
Bug fixes
Fix a crash caused by using a position potentially outside the document in splitBlock
.
Bug fixes
Fix a regression where all plugin views were recreated when calling setProps
.
Bug fixes
Fix a bug where, if the document was changed at exactly the right moment, handleClickOn
could be called with null
as the node.
Bug fixes
The insertText
method now collapses the selection to the end of the inserted text, even when given explicit start/end positions.
Bug fixes
Fix a bug where updating to a reconfigured state would not recreate the view's plugin views.
Bug fixes
Improve selection handling during text replacement.
Bug fixes
Fix a regression where mouse selection would sometimes raise an error.
New features
Changes made during compositions now immediately fire transactions on each update, rather than only a single one at the end of the composition.
The view now immediately shows changes to the document or decorations during composition, even if they come from transactions not directly generated by the use's editing. The only exception is decorations that affect the focused text node—those are still delayed to avoid unneccesarily canceling the composition.
Bug fixes
sinkListItem
will no longer copy the attributes of the parent list when creating an inner list.
Bug fixes
Improve display update times for nodes with thousands of children by fix an accidental piece of quadratic complexity.
Fixes an issue where changes to the nodeViews
prop weren't noticed when using updateState
to update the view.
Fix issue where sometimes moving the selection back its last position with the mouse failed to update ProseMirror's selection state.
No longer call deselectNode
on already-destroyed node views.
Bug fixes
Make sure images and links don't render whatever happens to be in node.attrs
to the DOM.
Bug fixes
Fix a regression from 1.8.4 that made it return unreasonable rectangles for positions between blocks.
Bug fixes
The handlePaste
prop is now activated even when the default parser can't make any sense of the clipboard content.
Bug fixes
Fix a bug where decorations splitting a text node would sometimes confuse the display updater and make decorated nodes disappear.
Bug fixes
Multiple transformPastedHTML
props are now all properly called in order, rather than only the first one.
Fixes an issue where invalid change positions were computed when a composition happened concurrently with a change that inserted content at the same position.
Bug fixes
EditorView.coordsAtPos
is now more accurate in right-to-left text on Chrome and Firefox.
EditorView.coordsAtPos
returns more accurate coordinates when querying the position directly after a line wrap point.
Fix an issue where clicking directly in front of a node selection doesn't clear the node selection markup.
Bug fixes
Fixes an issue where steps that cause multiple changed ranges (such as ReplaceAroundStep
) would cause invalid change sets.
Fix a bug in incremental change set updates that would cause incorrect results in a number of cases.
Bug fixes
Fix an issue where clicking when there's a non-text selection active sometimes doesn't cause the appropriate new selection.
Bug fixes
Fix an issue where a view state update happening between a change to the DOM selection and the corresponding browser event could disrupt mouse selection.
Bug fixes
Fix infinite loop in coordsAtPos
.
Bug fixes
Fix a bug where endOfTextblock
spuriously returns true when the cursor is in a mark.
New features
posAtCoords
will no longer return null
when called with coordinates outside the browser's viewport. (It will still return null for coordinates outside of the editor's bounding box.)
Bug fixes
endOfTextblock
now works on textblocks that are the editor's top-level node.
Bug fixes
Pressing shift-left/right next to a selectable node no longer selects the node instead of creating a text selection across it.
Bug fixes
Fix a bug that corrupted selection data in the history when applying remote steps in some cases.
Bug fixes
Fix an issue on Safari where an Enter key events that was part of a composition is interpreted as stand-alone Enter press.
Bug fixes
sinkListItem
no longer preserves marks from the outer list when creating an inner list.
New features
Mark specs now support a property 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.
Bug fixes
Fix an issue where node selections on uneditable nodes couldn't be copied or cut on Chrome.
New features
The editable view now recognizes the spanning
mark property.
Bug fixes
Inline code containing backticks is now serialized wrapped in the appropriate amount of backticks.
New features
The serializer now serializes links whose target is the same as their text content using < > syntax.
Mark opening and close string callbacks now get passed the mark's context (parent fragment and index).
Bug fixes
Make simplifyChanges
merge adjacent simplified changes (which can occur when a word boundary is inserted).
Bug fixes
Fix a bug in simplifyChanges that only occurred when the changes weren't at the start of the document.
Bug fixes
Fixes issue in simplifyChanges
where it sometimes returned nonsense when the inspected text wasn't at the start of the document.
Bug fixes
Don't output empty style attributes when a style property with a null value is present in renderSpec
.
Bug fixes
Solves various cases where complicated edits could corrupt the set of changes due to the mapped positions of deletions not agreeing with the mapped positions of insertions.
New features
Moves to a more efficient diffing algorithm (Meyers), so that large replacements can be accurately diffed using reasonable time and memory.
You can now find the original document given to a ChangeSet
with its startDoc
accessor.
Breaking changes
The way change data is stored in ChangeSet
objects works differently in this version. Instead of keeping deletions and insertions in separate arrays, the object holds an array of changes, which cover all the changed regions between the old and new document. Each change has start and end positions in both the old and the new document, and contains arrays of insertions and deletions within it.
This representation avoids a bunch of consistency problems that existed in the old approach, where keeping positions coherent in the deletion and insertion arrays was hard.
This means the deletions
and insertions
members in ChangeSet
are gone, and instead there is a changes
property which holds an array of Change
objects. Each of these has fromA
and toA
properties indicating its extent in the old document, and fromB
and toB
properties pointing into the new document. Actual insertions and deletions are stored in inserted
and deleted
arrays in Change
objects, which hold {data, length}
objects, where the total length of deletions adds up to toA - fromA
, and the total length of insertions to toB - fromB
.
When creating a ChangeSet
object, you no longer need to pass separate compare and combine callbacks. Instead, these are now represented using a single function that returns a combined data value or null
when the values are not compatible.
Bug fixes
When replacing a selection by typing over it with a letter that matches its start or end, the editor now generates a step that covers the whole replacement.
Fixes dragging a node when the mouse is in a child DOM element that doesn't represent a document node. Work around Chrome bug in selection management
Fixes an issue in Chrome where clicking at the start of a textblock after a selected node would sometimes not move the cursor there.
Fix issue where a node view's getPos
callback could sometimes return NaN
.
Fix an issue where deleting more than 5 nodes might cause the nodes after that to be needlessly redrawn.
Bug fixes
Avoids redrawing of content with marks when other content in front of it is deleted.
Bug fixes
Hard breaks at the end of an emphasized or strong mark are no longer serialized to invalid Markdown text.
Bug fixes
Work around a Chrome bug where programmatic changes near the cursor sometimes cause the visible and reported selection to disagree.
Changing the nodeView
prop will no longer leave outdated node views in the DOM.
Work around an issue where Chrome unfocuses the editor or scrolls way down when pressing down arrow with the cursor between the start of a textblock and an uneditable element.
Fix a bug where mapping decoration sets through changes that changed the structure of decorated subtrees sometimes produced corrupted output.
Bug fixes
Properly apply the heuristics for ignoring short matches when diffing, and adjust those heuristics to more agressively weed out tiny matches in large changes.
New features
The new changedRange
method can be used to compare two change sets and find out which range has changed.
New features
Add a new method, ChangeSet.map
to update the data associated with changed ranges.
Bug fixes
Work around Safari issue where deleting the last bit of text in a table cell creates weird HTML with a BR in a table row.
Bug fixes
The DOM parser now drops whitespace after BR nodes when not in whitespace-preserving mode.
Bug fixes
Fix crash when destroying the plugin, due to a misspelled method name.
Bug fixes
Fixes an issue where drop cursors changed line breaking, causing the content to jump around during dragging.
New features
Between-blocks drop cursors are now shown as a horizontal line.
Bug fixes
Fix pasting when both text and files are present on the clipboard.
Bug fixes
Fixes a bug where inline mark delimiters were serialized incorrectly (the closing and opening marks were swapped, which was only noticeable when they are different).
Bug fixes
The editor will no longer try to handle file paste events with the old-browser compatibility kludge (which might cause scrolling and focus flickering).
Bug fixes
Fix issue where mapSelectionBackward
didn't work because of a typo.
Bug fixes
Fixes an issue where event handlers were leaked when destroying an editor
Bug fixes
Appending a transaction to an undo transaction will no longer immediately clear the redo history.
When handling appended transactions, the history will keep the last step in the original transaction, not the one from the appended transaction, for testing whether a subsequent transaction is adjacent to the previous one.
Bug fixes
Fixes an issue where the Markdown serializer would escape special characters in inline code.
New features
Upgrade the markdown-it dependency to version 8.
Bug fixes
Prevent ContentMatch.findWrapping
from returning node types with required attributes.
Bug fixes
Fixes situation where a vertical endOfTextblock
query could get confused by nearby widgets or complex parent node representation.
Bug fixes
Don't blanket-forbid gap cursors next to textblocks
Bug fixes
Fixes a corner case in which DecorationSet.map would map decorations to incorrect new positions.
When the editor contains scrollable elements, scrolling the cursor into view also scrolls those.
New features
The scrollMargin
and scrollThreshold
props may now hold {left, right, top, bottom}
objects to set different margins and thresholds for different sides. Make scrolling from a given start node more robust
Bug fixes
Fix another issue where overlapping changes that can't be merged could produce a corrupt change set.
Bug fixes
The cursor is now scrolled into view after keyboard driven selection changes even when they were handled by the browser.
Bug fixes
Fixes an issue where addSteps
could produce invalid change sets when a new step's deleted range overlapped with an incompatible previous deletion.
Bug fixes
Improves selection management around widgets with no actual HTML content (possibly drawn using CSS pseudo elements).
Fix extra whitespace in pasted HTML caused by previously-collapsed spacing.
Slow triple-clicks are no longer treated as two double-clicks in a row.
Bug fixes
Fix issue where some DOM selections would cause a non-editable view to crash when reading the selection.
New features
Mark views are now passed a boolean that indicates whether the mark's content is inline as third argument.
New features
receiveTransaction
now supports a mapSelectionBackward
option that makes it so that text selections are mapped to stay in place when remote changes insert content at their position.
Bug fixes
Fix an issue where a non-empty DOM selection could stick around even though the state's selection is empty.
Fix an issue where Firefox would create an extra cursor position when arrow-keying through a widget.
Bug fixes
Fix an issue where the editor got stuck believing shift was down (and hence pasting as plain text) when it was unfocused with shift held down.
Bug fixes
Fix an issue where reading the selection from the DOM might crash in non-editable mode.
Bug fixes
Fixes an issue where backspacing out the last character between the start of a textblock and a widget in Chrome would insert a random hard break.
New features
The dispatchTransaction
prop is now called with this
bound to the editor view.
Bug fixes
Fix a bug where marks were sometimes parsed incorrectly.
Bug fixes
Fix an issue where Chrome Android would move the cursor forward by one after backspace-joining two paragraphs.
Bug fixes
The "appendedTransaction"
meta property on appended transactions now points to the root transaction instead of at the transaction itself, which it accidentally did before.
Bug fixes
Fix issue where marks would be applied to the wrong node when parsing a slice from DOM.
New features
Adds a new node spec property, toDebugString
, making it possible to customize your nodes' toString
behavior.
Bug fixes
Fix issue where menu items would still execute their command when clicked even if disabled.
Bug fixes
Fix bug that caused superfluous backslashes to be inserted at the start of some lines when serializing to Markdown.
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.
Bug fixes
Fixes a bug in the default implementation of Selection.getBookmark
.
Bug fixes
Fix a crash when scrolling things into view when the editor isn't a child of document.body
.
Bug fixes
Fix issue where replaceRange
might create invalid nodes.
Bug fixes
Fix issues in the new dropPoint
function.
Bug fixes
Make sure Safari version detection for clipboard support also works in iOS webview.
New features
Transform.getMirror
, usable in obscure circumstances for inspecting the mirroring structure or a transform, is now a public method.
New utility function dropPoint
, which tries to find a valid position for dropping a slice near a given document position.
Bug fixes
Use shared implementation of dropPoint
to handle finding a drop position.
Bug fixes
Enable use of browser clipboard API on Mobile Safari version 11 and up, which makes cut work on that platform and should generally improve clipboard handling.
New features
You can now override the handling of softbreak tokens in a custom handler.
Bug fixes
Dragging from a content node directly to the outside of the editor will now properly hide the drop cursor.
Make removal of drop cursor part of the drop transaction when possible.
Use dropPoint
from prosemirror-transform, rather than a local parallel implementation.
Bug fixes
Fix arrow-left cursor motion from cursor wrapper (for example after a link).
Fix selection glitches when shift-selecting around widget decorations.
Fix issue where a parsing a code block from the editor DOM might drop newlines in the code.
Bug fixes
handleKeyDown
will now get notified of key events happening directly after a composition ends.
Bug fixes
The package can now be loaded in a web worker context (where navigator
is defined but document
isn't) without crashing.
Dropping something like a list item into a textblock will no longer split the textblock.
New features
ParseRule.getContent
is now passed the parser schema as second argument.
Bug fixes
Fix a regression where DOMParser.parse
would fail to apply mark nodes directly at the start of the input.
Bug fixes
DOMParser.parseSlice
can now correctly parses marks at the top level again.
Bug fixes
Fix mouse-selecting (in IE and Edge) from the end of links and other positions that cause a cursor wrapper.
Widget decorations with the same key are now considered equivalent, even if their other spec fields differ.
New features
The new EditorView.posAtDOM
method can be used to find the document position corresponding to a given DOM position.
The new EditorView.nodeDOM
method gives you the DOM node that is used to represent a specific node in the document.
Decoration.widget
now accepts a function as second argument, which can be used to delay rendering of the widget until the document is drawn (at which point a reference to the view is available).
The getPos
function passed to a node view constructor can now be called immediately (it used to return undefined until rendering had finished).
The function used to render a widget is now passed a getPos
method that event handlers can use to figure out where in the DOM the widget is.
Bug fixes
Fix crash when serializing marks with line breaks inside of them.
Bug fixes
Remove a console.log
that was accidentally left in the previous release.
Bug fixes
Transform.setBlockType
no longer drops marks on the nodes it updates.
Bug fixes
DOMParser
can now parse marks on block nodes.
Bug fixes
Fixes an issue where joinBackward
might create a selection pointing into the old document.
Bug fixes
Fix a bug that made replaceStep
unable to generate wrapper nodes in some circumstances.
New features
EditorState.create
now accepts a storedMark
option to set the state's stored marks.
EditorState.toJSON
and fromJSON
persist the set of stored marks, when available.
Bug fixes
Fixes an issue where replaceStep
could generate slices that internally violated the schema.
Bug fixes
The setBlockType
command command is now considered applicable when any of the selected textblocks can be changed (it used to only look at the first one).
Fix crash when calling splitBlock
when the selection isn't in a block node (by disabling the command in that case).
Fixes an issue where joinForward
might create a selection pointing into the old document.
New features
ContentMatch.defaultType
, a way to get a matching node type at a content match position, is now public.
New features
ContentMatch
objects now have an edgeCount
property and an edge
method, providing direct access to the finite automaton structure.
Bug fixes
Transform.deleteRange
will cover unmatched opening at the start of the deleted range.
Bug fixes
Fixes a bug that caused wrapInList
to split list items in the wrong place.
Bug fixes
Throw errors, rather than constructing invalid objects, when deserializing from invalid JSON data.
Bug fixes
Content expressions with text nodes in required positions now raise the appropriate error about being unable to generate such nodes.
Bug fixes
Throw errors, rather than constructing invalid objects, when deserializing from invalid JSON data.
Bug fixes
Throw errors, rather than constructing invalid objects, when deserializing from invalid JSON data.
Bug fixes
Throw errors, rather than constructing invalid objects, when deserializing from invalid JSON data.
Bug fixes
rangeHasMark
now always returns false for empty ranges.
The DOM renderer no longer needlessly splits mark nodes when starting a non-rendered mark.
New features
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.
Bug fixes
replaceStep
will now return null rather than an empty step when it fails to place the slice.
Avoid duplicating defining parent nodes in replaceRange
.
Bug fixes
Fix a problem where updating the state of a non-editable view would not set the selection, causing problems when the DOM was updated in a way that disrupted the DOM selection.
Fix an issue where, on IE and Chrome, starting a drag selection in a position that required a cursor wrapper (on a mark boundary) would sometimes fail to work.
Fix crash in key handling when the editor is focused but there is no DOM selection.
Fixes a bug that prevented decorations inside node views with a contentDOM
property from being drawn.
Fixes an issue where, on Firefox, depending on a race condition, the skipping over insignificant DOM nodes done at keypress was canceled again before the keypress took effect.
Fixes an issue where an :after
pseudo-element on a non-inclusive mark could block the cursor, making it impossible to arrow past it.
New features
The DOM structure for marks is no longer constrained to a single node. Mark views can have a contentDOM
property, and mark spec toDOM
methods can return structures with holes.
Widget decorations are now wrapped in the marks of the node after them when their side
option is >= 0.
Widget decorations may now specify a marks
option to set the precise set of marks they should be wrapped in.
Bug fixes
Fix a bug that could corrupt the history when rebasing changes because of collaborative editing.
Bug fixes
Fixes a bug that prevented the menu bar from properly unregistering its "scroll"
event handlers when destroyed.
Bug fixes
Fix crash that could occur (in specific circumstance) when redoing.
Bug fixes
Fixes typo that broke paste.
Bug fixes
Fixes issue where dragging a draggable node directly below a selected node would move the old selection rather than the target node.
A drop that can't fit the dropped content will no longer dispatch an empty transaction.
New features
Transactions generated for drop now have a "uiEvent"
metadata field holding "drop"
. Paste and cut transactions get that field set to "paste"
or "cut"
.
Bug fixes
Fix overeager closing of destination nodes when fitting a slice during replacing.
Bug fixes
Fix a problem where slice-placing didn't handle content matches correctly and might generate invalid steps or fail to generate steps though a valid one exists.
Allows adjacent nodes from an inserted slice to be placed in different parent nodes, allowing Transform.replace
to create fits that weren't previously found.
Bug fixes
Upgrade w3c-keyname
dependency to version 1.1.8 to prevent users getting stuck with a buggy version.
Bug fixes
Fix issue where the cursor was visible when a node was selected on recent Chrome versions.
Bug fixes
Prevent issue where clicking on a selectable node near a valid gap cursor position would create a gap cursor rather than select the node.
Bug fixes
The floating menu bar now works better in a scrollable parent node.
Bug fixes
Fix crash in splitBlock
when defaultContentType
returns null.
Bug fixes
Fixes a crash in replace
.
Bug fixes
Improve preservation of open and closed nodes in slices taken from the clipboard.
New features
EditorState.toJSON
now accepts a string or number as argument to support the way JSON.stringify
can call it.
Bug fixes
Pressing delete in front of an isolating node no longer opens it.
Bug fixes
Work around a Chrome cursor motion bug by making sure
nodes don't get a contenteditable=false attribute.
Bug fixes
Make the render
property of a menu item spec work as documented again.
Bug fixes
Fix dependency version range for prosemirror-model.
Bug fixes
Fix issue where Decoration.map
would in some situations with nested nodes incorrectly map decoration positions.
New features
Slice.maxOpen
now has a second argument that can be used to prevent it from opening isolating nodes.
Bug fixes
Pasting from an external source no longer opens isolating nodes like table cells.
Bug fixes
Fix overly restrictive depencency version ranges.
Bug fixes
DecorationSet.remove
now uses a proper deep compare to determine if widgets are the same (it used to compare by identity).
Bug fixes
Fix issue where joinBackward
would sometimes create an invalid selection.
Bug fixes
Fix issue where a character might be selected after overwriting across block nodes.
Make sure replaceSelectionWith
doesn't needlessly copy unmarked nodes.
Bug fixes
Code blocks are always wrapped in triple backticks when serializing, to avoid parsing corner cases around indented code blocks.
Bug fixes
Fix an issue where deeply nested decorations were mapped incorrectly in corner cases.
Bug fixes
Fix a corner-case crash during drop.
Bug fixes
The example menu now allows you to enter relative links without automatically adding http:// in front of them.
Bug fixes
Pressing backspace between two identical characters will no longer generate a transaction that deletes the second one.
Bug fixes
splitBlock
no longer crashes when used in a block that's it's parent node's only allowed child.
Bug fixes
Fix test for whether a node can be selected when arrowing onto it from the right.
Calling posAtCoords
while a read from the DOM is pending will no longer return a malformed result.
Bug fixes
ReplaceError
instances now properly inherit from Error
.
Bug fixes
The errors raised by Transform.step
now properly inherit from Error.
Bug fixes
Deleting the last character in a list item no longer results in a spurious hard_break node on Safari.
Fixes a crash on IE11 when starting to drag.
Bug fixes
Input rules no longer fire in blocks that have their code
spec set to true.
Bug fixes
Fix issue where deleting, inserting, and deleting the same content would lead to an inconsistent change set.
Bug fixes
Link marks are now non-inclusive (typing after them produces non-linked text).
Bug fixes
Typing over marked text now properly makes the new text inherit the old text's marks.
Bug fixes
Fix a bug that caused addSteps
to break when merging two insertions into a single deletion.
Bug fixes
The menu no longer flips enabled/disabled styles on each update in IE11.
Bug fixes
Fix crash in ChangeSet.addSteps
.
New features
ParseRule.context
may now include multiple, pipe-separated context expressions.
Bug fixes
When setBlockType
comes across a textblock that can't be changed due to schema constraints, it skips it instead of failing.
canSplit
now returns false when the requested split goes through isolating nodes.
Bug fixes
Dragging nodes with a node view that handles its own mouse events should work better now.
List item DOM nodes are no longer assigned pointer-events: none
in the default style. Ctrl-clicking list markers now properly selects the list item again.
Arrow-down through an empty textblock no longer causes the browser to forget the cursor's horizontal position.
Copy-dragging on OS X is now done by holding option, rather than control, following the convention on that system.
Fixes a crash related to decoration management.
Fixes a problem where using cut on IE11 wouldn't actually remove the selected text.
Copy/paste on Edge 15 and up now uses the clipboard API, fixing a problem that made them fail entirely.
New features
The dragging
property of a view, which contains information about editor content being dragged, is now part of the public interface.
New features
The setBlockType
command can now be used to change the types of multiple selected textblocks (rather than only one).
The platform-dependent versions of the base keymap are now exported separately as pcBaseKeymap
and macBaseKeymap
.
New features
Valid gap cursor positions are not determined in a way that allows them inside nested nodes. By default, any position where a textblock can be inserted is valid gap cursor position.
Nodes can override whether they allow gap cursors with the allowGapCursor
property in their spec.
Breaking changes
The setNodeType
method on transforms is now more descriptively called setNodeMarkup
. The old name will continue to work with a warning until the next release.
New features
The clipboardTextParser
prop is now passed a context position.
New features
It is no longer necessary to manually enable the preserveItems
option to the history plugin when using collaborative editing. (This behavior is now automatically enabled when necessary.)
Bug fixes
NodeType.allowsMarks
and allowedMarks
now actually work for nodes that allow only specific marks.
Breaking changes
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).
Bug fixes
Fix issue where whitespace at node boundaries was sometimes dropped during content parsing.
Attribute default values of undefined
are now allowed.
New features
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.
Breaking changes
Step.toJSON
no longer has a default implementation.
Steps no longer have an offset
method. Map them through a map created with StepMap.offset
instead.
The clearMarkup
method on Transform
is no longer supported (you probably needed 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
.
New features
StepMap
now has a static method offset
, which can be used to create a map that offsets all positions by a given distance.
Transform objects now have a clearIncompatible
method that can help make sure a node's content matches another node type.
Breaking changes
The onFocus
, onBlur
, and handleContextMenu
props are no longer supported. You can achieve their effect with the handleDOMEvents
prop.
Bug fixes
Fixes occasional crash when reading the selection in Firefox.
Putting a table cell on the clipboard now properly wraps it in a table.
The view will no longer scroll into view when receiving a state that isn't derived from its previous state.
New features
Transactions caused by a paste now have their "paste" meta property set to true.
Adds a new view prop, handleScrollToSelection
to override the behavior of scrolling the selection into view.
The new editor prop clipboardTextSerializer
allows you to override the way a piece of document is converted to clipboard text.
Adds the editor prop clipboardTextParser
, which can be used to define your own parsing strategy for clipboard text content.
DecorationSet.find
now supports passing a predicate to filter decorations by spec.
Breaking changes
Schema-specific rule-builders blockQuoteRule
, orderedListRule
, bulletListRule
, codeBlockRule
, and headingRule
, along with the allInputRules
array, are no longer included in this module.
Breaking changes
joinForward
and joinBackward
no longer fall back to selecting the next node when no other behavior is possible. There are now separate commands selectNodeForward
and selectNodeBackward
that do this, which the base keymap binds as fallback behavior.
baseKeymap
no longer binds keys for joinUp
, joinDown
, lift
, and selectParentNode
.
New features
New commands selectNodeForward
and selectNodeBackward
added.
Bug fixes
The splitListItem
command now splits the parent list item when executed in a (trailing) empty list item in a nested list.
Bug fixes
Invisible selections that don't cover any content (i.e., a cursor) are now properly hidden.
Initializing the editor view non-editable no longer causes a crash.
Bug fixes
Bindings like Alt-3 should now fire even if your keyboard produces a special character for that combination.
Bug fixes
Fix another bug in the way canSplit
interpreted its typesAfter
argument.
Bug fixes
Fix crash in canSplit
when an array containing null fields is passed as fourth argument.
Bug fixes
When using parseSlice
, inline DOM content wrapped in block elements for which no parse rule is defined will now be properly wrapped in a textblock node.
New features
Resolved positions now have a doc
accessor to easily get their root node.
Parse rules now support a namespace
property to match XML namespaces.
The NodeRange
constructor is now public (whereas before you could only construct these through blockRange
).
Bug fixes
canSplit
now returns false when given custom after-split node types that don't match the content at that point.
Fixes canLift
incorrectly returning null when lifting into an isolating node.
Bug fixes
Fix an issue where moving the cursor through a text widget causes the editor to lose the selection in Chrome.
Fixes an issue where down-arrow in front of a widget would sometimes not cause any cursor motion on Chrome.
Destroying a mounted editor view no longer leaks event handlers.
Display updates for regular, non-composition input are now synchronous, which should reduce flickering when, for example, updating decorations in response to typing.
New features
The editor can now be initialized in a document other than the global document (say, an iframe
).
Editor views now have a domAtPos
method, which gives you the DOM position corresponding to a given document position.
Bug fixes
Input rules with spaces in them now match any whitespace where the space is expected, to avoid mysteriously not working when a non-breaking space is present.
Bug fixes
addMark
no longer assumes marks always exclude only themselves.
replaceRange
](https://prosemirror.net/docs/ref/version/0.21.0.html#transform.Transform.replaceRange) and deleteRange
will no longer expand the range across isolating node boundaries.
Bug fixes
Copying and pasting table cells on Edge no longer strips the table structure.
Breaking changes
The openLeft
and openRight
properties of Slice
objects have been renamed to openStart
and 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 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
can now be used to omit that mark when serializing.
Node specs support a new property isolating
, which is used to disable editing actions like backspacing and lifting across such a node's boundaries.
Breaking changes
Selection.atStart
, and atEnd
no longer take a second textOnly
parameter.
New features
Selection.near
, atStart
, and atEnd
will now fall back to returning an AllSelection
when unable to find a valid selection. This removes the (undocumented) requirement that documents always contain a valid selection position (though you'll probably still want to maintain this for practical UI reasons).
Breaking changes
The associative
option to widget decorations is no longer supported. To make a widget left-associative, set its side
option to a negative number. associative
will continue to work with a warning until the next release.
New features
Widget decorations now support a side
option that controls which side of them the cursor is drawn, where they move when content is inserted at their position, and the order in which they appear relative to other widgets at the same position.
Bug fixes
Fixes an issue where the DOM selection could be shown on the wrong side of hard break or image nodes.
Bug fixes
Fix a bug that prevented the DOM selection from being updated when the new position was near the old one in some circumstances.
Stop interfering with alt-d keypresses on OS X.
Fix issue where reading a DOM change in a previously empty node could crash.
Fixes crash when reading a change that removed a decorated text node from the DOM.
Bug fixes
Shift-pasting and pasting into a code block now does the right thing on IE and Edge.
Bug fixes
Fixes a bug that broke dragging from the editor.
Bug fixes
Typing in code blocks no longer replaces newlines with spaces.
Copy and paste on Internet Explorer, Edge, and mobile Safari should now behave more like it does on other browsers. Handlers are called, and the changes to the document are made by ProseMirror's code, not the browser.
Fixes a problem where triple-clicking the editor would sometimes cause the scroll position to inexplicably jump around on IE11.
Breaking changes
Newlines in the text are now normalized to spaces when parsing except when you set preserveWhitespace
to "full"
in your options or in a parse rule.
Bug fixes
Fix crash in IE when parsing DOM content.
New features
Fragments now have nodesBetween
and descendants
methods, providing the same functionality as the methods by the same name on nodes.
Resolved positions now have max
and min
methods to easily find a maximum or minimum position.
Bug fixes
Fixes issue where replacing would sometimes unexpectedly split nodes.
Breaking changes
Selection.near
no longer accepts a textOnly
parameter.
Bug fixes
TextSelection.between
may now return a node selection when the document does not contain a valid cursor position.
New features
Selection
objects now implement a content
method that returns their content. This is used to determine what ends up on the clipboard when the selection is copied or dragged.
Selections may now specify multiple ranges that they cover, to generalize to more types of selections. The Selection
superclass constructor takes an array of ranges as optional third argument.
Selections gained new methods replace
and replaceWith
to provide subclasses more control over how selections of that type respond to being deleted or overwritten.
Selections have a new method getBookmark
that custom selection classes can implement to allow the undo history to accurately store and restore them.
The new selection class AllSelection
can be used to select the entire document.
Breaking changes
The inclusiveLeft
and inclusiveRight
options to inline decorations were renamed to inclusiveStart
and inclusiveEnd
so that they also make sense in right-to-left text. The old names work with a warning until the next release.
The default styling for lists and blockquotes was removed from prosemirror.css
. (They were moved to the example-setup
module.)
Bug fixes
Fixes reading of selection in Chrome in a shadow DOM.
Registering DOM event handlers that the editor doesn't listen to by default with the handleDOMEvents
prop should work again.
Backspacing after turning off a mark now works again in Firefox.
New features
The new props handlePaste
and handleDrop
can be used to override drop and paste behavior.
Breaking changes
The input rules plugin no longer implicitly binds backspace to undo the last applied rule.
New features
This module now exposes a command undoInputRule
, which will revert an input rule when run directly after one was applied.
Bug fixes
Appended transactions no longer generate undo history events.
New features
The new selectAll
command, bound to Mod-a in the base keymap, sets the selection to an AllSelection
.
New features
The liftListItem
command can now lift items out of a list entirely, when the parent node isn't another list.
Bug fixes
Fixes a number of issues with characters being duplicated or disappearing when typing on mark boundaries.
Bug fixes
Fix an issue where ensureMarks
would fail to reset the marks to the empty set when turning off the last mark.
Breaking changes
MarkSpec.inclusiveRight
was replaced by inclusive
, which behaves slightly differently. inclusiveRight
will be interpreted as inclusive
(with a warning) until the next release.
New features
The new inlineContent
property on nodes and node types tells you whether a node type supports inline content.
MarkSpec.inclusive
can now be used to control whether content inserted at the boundary of a mark receives that mark.
Parse rule context
restrictions can now use node groups, not just node names, to specify valid context.
Breaking changes
Selection.between
is now called TextSelection.between
, and only returns text selections.
The JSON representation of selections changed. fromJSON
will continue to understand the old representation, but if your own code touches the JSON data, you'll have to adjust it.
All Selection
objects now have $head
/$anchor
properties, so those can no longer be used to recognize text selections (use $cursor
or instanceof
).
New features
It is now possible to write your own Selection
subclasses and set the editor selection to an instance of them (provided you implement all required methods and register them with Selection.jsonID
).
Text selections now have a $cursor
getter which returns a position only if this is a cursor selection.
The new Transaction.ensureMarks
method makes it easier to ensure given set of active marks without needlessly setting storedMarks
.
Breaking changes
endOfTextblock
no longer always returns false for horizontal motion on non-cursor selections, but checks the position of the selection head instead.
Bug fixes
Typing after adding/removing a mark no longer briefly shows the new text with the wrong marks.
posAtCoords
is now more reliable on modern browsers by using browser APIs.
Fix a bug where the view would in some circumstances leave superfluous DOM nodes around inside marks.
New features
You can now override the selection the editor creates for a given DOM selection with the createSelectionBetween
prop.
New features
A new function closeHistory
can be used to force separation of history events at the start of a given transaction.
New features
You can now use strings (as well as numbers) as client IDs (this already worked, but now the documentation reflects this).
Bug fixes
Calling joinBackward
at the start of a node that can't be joined no longer raises an error.
Breaking changes
Link marks are now non-inclusive by default.
Breaking changes
schema.nodeSpec
and schema.markSpec
have been deprecated in favor of schema.spec
. The properties still work with a warning in this release, but will be dropped in the next.
New features
Node
objects now have a check
method which can be used to assert that they conform to the schema.
Node specs now support an atom
property, and nodes an isAtom
accessor, which is currently only used to determine whether such nodes should be directly selectable (for example when they are rendered as an uneditable node view).
The new excludes
field on mark specs can be used to control the marks that this mark may coexist with. Mark type objects also gained an excludes
method to querty this relation.
Mark specs now support a group
property, and marks can be referred to by group name in content specs.
The Schema
class now provides its whole spec under its spec
property.
The name of a schema's default top-level node is now configurable. You can use schema.topNodeType
to retrieve the top node type.
Parse rules now support a context
field that can be used to only make the rule match inside certain ancestor nodes.
New features
Transform.setNodeType
now takes an optional argument to set the new node's attributes.
Steps now provide an offset
method, which makes it possible to create a copy the step with its position offset by a given amount.
docChanged
is now a property on the Transform
class, rather than its Transaction
subclass.
Mapping
instances now have invert
and appendMappingInverted
methods to make mapping through them in reverse easier.
Breaking changes
Plugin objects now store their spec under a spec
instead of an options
property. The options
property still works with a warning in this release.
Breaking changes
Decoration
objects now store their definition object under spec
, not options
. The old property name still works, with a warning, until the next release.
Bug fixes
Fix bug where calling focus
when there was a text selection would sometimes result in state.selection
receiving an incorrect value.
EditorView.props
now has its state
property updated when you call updateState
.
Putting decorations on or inside a node view with an update
method now works.
New features
Plugin view update methods are now passed the view's previous state as second argument.
The place
agument to the EditorView
constructor can now be an object with a mount
property to directly provide the node that should be made editable.
The new EditorView.setProps
method makes it easier to update individual props.
New features
Add a keydownHandler
function, which takes a keymap and produces a handleKeydown
prop-style function.
Bug fixes
Fix a problem where simultaneous collaborative editing could break the undo history.
New features
sendableSteps
now also returns information about the original transactions that produced the steps.
New features
New command splitBlockKeepMarks
which splits a block but preserves the marks at the cursor.
Bug fixes
Transaction.scrolledIntoView
no longer always returns true.
Selection.near
now takes a third textOnly
argument, as the docs already claimed.
Bug fixes
Fixes crash in the code that maintains the scroll position when the document is empty or hidden.
Bug fixes
Transactions that shouldn't scroll the selection into view now no longer do so.
Bug fixes
Fixes bug where widget decorations would sometimes get parsed as content when editing near them.
The editor now prevents the behavior of Ctrl-d and Ctrl-h on textblock boundaries on OS X, as intended.
Make sure long words don't cause a horizontal scrollbar in Firefox
Various behavior fixes for IE11.
Bug fixes
Fix issue where collaborative editing corner cases could corrupt the history.
Bug fixes
DOM changes deleting a node's inner wrapping DOM element (for example the <code>
tag in a schema-basic code block) no longer break the editor.
Bug fixes
Call custom click handlers before applying select-node behavior for a ctrl/cmd-click.
Fix failure to apply DOM changes that start at document position 0.
Bug fixes
Make sure toggleMark
also works in the top-level node (when it is a textblock).
Bug fixes
Fix issue where a document update that left the selection in the same place sometimes led to an incorrect DOM selection.
Make sure EditorView.focus
doesn't cause the browser to scroll the top of the editor into view.
Breaking changes
Node.marksAt
was replaced with ResolvedPos.marks
. It still works (with a warning) in this release, but will be removed in the next one.
Breaking changes
The way state is updated was changed. Instead of applying an action (a raw object with a type
property), it is now done by applying a Transaction
.
The EditorTransform
class was renamed Transaction
, and extended to allow changing the set of stored marks and attaching custom metadata.
New features
Plugins now accept a filterTransaction
option that can be used to filter out transactions as they come in.
Plugins also got an appendTransaction
option making it possible to follow up transactions with another transaction.
Breaking changes
The handleDOMEvent
prop has been dropped in favor of the handleDOMEvents
(plural) prop.
The onChange
prop has been replaced by a dispatchTransaction
prop (which takes a transaction instead of an action).
New features
Added support for a handleDOMEvents
prop, which allows you to provide handler functions per DOM event, and works even for events that the editor doesn't normally add a handler for.
Add view method dispatch
, which provides a convenient way to dispatch transactions.
The dispatchTransaction
(used to be onAction
) prop is now optional, and will default to simply applying the transaction to the current view state.
Widget decorations now accept an option associative
which can be used to configure on which side of content inserted at their position they end up.
Typing immediately after deleting text now preserves the marks of the deleted text.
Transactions that update the selection because of mouse or touch input now get a metadata property pointer
with the value true
.
Breaking changes
The dispatch
function passed to commands is now passed a Transaction
, not an action object.
New features
Plugins now take a view
option that can be used to interact with the editor view.
Bug fixes
Solve problem where setting a node selection would trigger a DOM read, leading to the selection being reset.
Breaking changes
The spellcheck
, label
, and class
props are now replaced by an attributes
prop.
Bug fixes
Ignoring/aborting an action should no longer lead to the DOM being stuck in an outdated state.
Typing at the end of a textblock which ends in a non-text node now actually works.
DOM nodes for leaf document nodes are now set as non-editable to prevent various issues such as stray cursors inside of them and Firefox adding image resize controls.
Inserting a node no longer causes nodes of the same type after it to be neednessly redrawn.
New features
Add a new editor prop editable
which controls whether the editor's contentEditable
behavior is enabled.
Plugins and props can now set any DOM attribute on the outer editor node using the attributes
prop.
Node view constructors and update methods now have access to the node's wrapping decorations, which can be used to pass information to a node view without encoding it in the document.
Attributes added or removed by node and inline decorations no longer cause the nodes inside of them to be fully redrawn, making node views more stable and allowing CSS transitions to be used.
Breaking changes
ResolvedPos.atNodeBoundary
is deprecated and will be removed in the next release. Use textOffset > 0
instead.
New features
Parse rules associated with a schema can now specify a priority
to influence the order in which they are applied.
Resolved positions have a new getter textOffset
to find their position within a text node (if any).
Bug fixes
Fix bug where pasted/inserted content would sometimes get incorrectly closed at the right side.
Breaking changes
Selection actions no longer scroll the new selection into view by default (they never were supposed to, but due to a bug they did). Add a scrollIntoView
property to the action to get this behavior.
Bug fixes
The native selection is now appropriately hidden when there is a node selection.
Bug fixes
Fix DOM parsing for decorated text nodes.
Breaking changes
The editor view no longer wraps its editable DOM element in a wrapper element. The ProseMirror
CSS class now applies directly to the editable element. The ProseMirror-content
CSS class is still present for ease of upgrading but will be dropped in the next release.
The editor view no longer draws a drop cursor when dragging content over the editor. The new prosemirror-dropcursor
module implements this as a plugin.
Bug fixes
Simple typing and backspacing now gets handled by the browser without ProseMirror redrawing the touched nodes, making spell-checking and various platform-specific input tricks (long-press on OS X, double space on iOS) work in the editor.
Improve tracking of DOM nodes that have been touched by user changes, so that updateState
can reliably fix them.
Changes to the document that happen while dragging editor content no longer break moving of the content.
Adding or removing a mark directly in the DOM (for example with the bold/italic buttons in iOS' context menu) now produces mark steps, rather than replace steps.
Pressing backspace at the start of a paragraph on Android now allows key handlers for backspace to fire.
Toggling a mark when there is no selection now works better on mobile platforms.
New features
Introduces an endOfTextblock
method on views, which can be used to find out in a bidi- and layout-aware way whether the selection is on the edge of a textblock.
Breaking changes
Drops suppport for delete(Char|Word)(Before|After)
and move(Back|For)ward
, since we are now letting the browser handle those natively.
Bug fixes
The joinForward
and joinBackward
commands can now strip out markup and nodes that aren't allowed in the joined node.
New features
A new command exitCode
allows a user to exit a code block by creating a new paragraph below it.
The joinForward
and joinBackward
commands now use a bidirectional-text-aware way to determine whether the cursor is at the proper side of its parent textblock when they are passed a view.
Bug fixes
Fix issue where node decorations would stick around in the DOM after the decoration was removed.
Setting or removing a node selection in an unfocused editor now properly updates the DOM to show that selection.
Bug fixes
DOMParser.parseSlice
will now ignore whitespace-only text nodes at the top of the slice.
Bug fixes
FIX: Avoid unneeded selection resets which sometimes confused browsers.
Bug fixes
Fix a bug where inverted selections weren't created in the DOM correctly.
Bug fixes
Restores previously broken kludge that allows the cursor to appear after non-text content at the end of a line.
New features
Parse rules now support skip
(skip outer element, parse content) and getContent
(compute content using custom code) properties.
The DOMSerializer
class now exports a static renderSpec
method that can help render DOM spec arrays.
New features
Selection actions now have a time
field and an (optional) origin
field.
Breaking changes
Wrapping decorations are now created using the nodeName
property. The wrapper
property is no longer supported.
The onUnmountDOM
prop is no longer supported (use a node view with a destroy
method instead).
The domSerializer
prop is no longer supported. Use node views to configure editor-specific node representations.
New features
Widget decorations can now be given a key
property to prevent unneccesary redraws.
The EditorView
class now has a destroy
method for cleaning up.
The handleClickOn
prop and friends now receive a direct
boolean argument that indicates whether the node was clicked directly.
Widget decorations now support a stopEvent
option that can be used to control which DOM events that pass through them should be ignored by the editor view.
You can now specify custom node views for an editor view, which give you control over the way node of a given type are represented in the DOM. See the related RFC.
Bug fixes
Fixes an issue where widget decorations in the middle of text nodes would sometimes disappear.
Bug fixes
Fixes event handler crash (and subsequent bad default behavior) when pasting some types of external HTML into an editor.
Breaking changes
ResolvedPos.sameDepth
is now called ResolvedPos.sharedDepth
, and takes a raw, unresolved position as argument.
New features
DOMSerializer
's nodes
and marks
properties are now public.
ContentMatch.findWrapping
now takes a third argument, marks
. There's a new method findWrappingFor
that accepts a whole node.
Adds Slice.maxOpen
static method to create maximally open slices.
DOM parser objects now have a parseSlice
method which parses an HTML fragment into a Slice
, rather than trying to create a whole document from it.
Bug fixes
Fix issue where Transform.replace
would, in specific circumstances, unneccessarily drop content.
New features
The new Transform
method replaceRange
, replaceRangeWith
, and 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.
Breaking changes
EditorTransform.replaceSelection
now takes a slice, no longer a node. The new replaceSelectionWith
method should be used to replace the selection with a node. Until the next release, calling it the old way will still work and emit a warning.
Bug fixes
The documentation for applyAction
now actually reflects the arguments this method is given.
New features
A state field's applyAction
method is now passed the previous state as 4th argument, so that it has access to the new doc and selection.
EditorTransform.replaceSelection
now accepts a slice (or, as before, as a node), and uses a revised algorithm, relying on the defining
node flag.
The TextSelection
and NodeSelection
classes now have a static create
convenience method for creating selections from unresolved positions.
Allow transform actions to be extended during dispatch using extendTransformAction
. Introduce sealed
flag to indicate when this is not safe.
A new utility function NodeSelection.isSelectable
can be used to test whether a node can be the target of a node selection.
Breaking changes
Selecting nodes on OS X is now done with cmd-leftclick rather than ctrl-leftclick.
Bug fixes
Pasting text into a code block will now insert the raw text.
Widget decorations at the start or end of a textblock no longer block horizontal cursor motion through them.
Widget nodes at the end of textblocks are now reliably drawn during display updates.
New features
DecorationSet.map
now takes an options object which allows you to specify an onRemove
callback to be notified when remapping drops decorations.
The transformPastedHTML
and transformPastedText
props were (re-)added, and can be used to clean up pasted content.
New features
The autoJoin
function allows you to wrap command functions so that when the command makes nodes of a certain type occur next to each other, they are automatically joined.
Bug fixes
Inline decorations that span across an empty textblock no longer crash the display drawing code.
Bug fixes
Fix bug in Transform.setBlockType
when used in a transform that already has steps.
Bug fixes
Use a separate document to parse pasted HTML to better protect
against cross-site scripting attacks.
Specifying multiple classes in a decoration now actually works.
Ignore empty inline decorations when building a decoration set.
Bug fixes
Fix crash in undo or redo commands when the history is empty.
Breaking changes
Drops support for some undocumented options to the DOM
serializer that were used by the view.
Bug fixes
When rendering DOM attributes, only ignore null values, not all
falsy values.
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.)
Breaking changes
The interace to
EditorState.toJSON
and
EditorState.fromJSON
has changed.
The way plugins declare their state
field has changed. Only one
state field per plugin is supported, and state fields no longer have
hard-coded names. Plugin.getState
is the
way to access plugin state now.
Plugin dependencies are no longer supported.
Plugin.reconfigure
is gone. Plugins are now always created
with new Plugin
.
Plugins no longer have a config
field.
Bug fixes
Node selections are now properly dropped when mapped over a
change that replaces their nodes.
New features
Plugin keys can now be used to find
plugins by identity.
Transform actions now have a
time
field containing the timestamp when the change was made.
Breaking changes
The return value of
EditorView.posAtCoords
changed to
contain an inside
property pointing at the innermost node that the
coordinates are inside of. (Note that the docs for this method were
wrong in the previous release.)
Bug fixes
Reduce reliance on shift-state tracking to minimize damage when
it gets out of sync.
Fix bug that'd produce bogus document positions for DOM positions
inside non-document nodes.
Don't treat fast ctrl-clicks as double or triple clicks.
New features
Implement decorations, a way to
influence the way the document is drawn. Add the decorations
prop to specify them.
Breaking changes
Key names are now based on
KeyboardEvent.key
instead of
.code
.
This means that, for character-producing keys, you'll want to use the
character typed, not the key name. So Ctrl-Z
now means uppercase Z,
and you'll usually want Ctrl-z
instead. Single-quoted key names are
no longer supported.
Breaking changes
The history
export is now a function
that creates a history plugin, rather than a plugin instance.
New features
Add a
newGroupDelay
plugin
option. This brings back the behavior where pausing between edits will
automatically cause the history to put subsequent changes in a new
undo event.
Bug fixes
Fix crash when backspacing into nodes with complex content
expressions.
Bug fixes
Don't treat <b style=font-weight: normal> as strong when parsing.
(Google Docs puts such ridiculous HTML on the clipboard.)
Bug fixes
Pass actual event object to handleDOMEvent
, rather than just its name.
Fix display corruption caused by using the wrong state as previous version during IME.