prosemirror-model
Advanced tools
Comparing version 1.6.2 to 1.6.3
@@ -0,1 +1,7 @@ | ||
## 1.6.3 (2018-10-26) | ||
### Bug fixes | ||
The DOM parser now drops whitespace after BR nodes when not in whitespace-preserving mode. | ||
## 1.6.2 (2018-10-01) | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "prosemirror-model", | ||
"version": "1.6.2", | ||
"version": "1.6.3", | ||
"description": "ProseMirror's document model", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
# prosemirror-model | ||
[ [**WEBSITE**](http://prosemirror.net) | [**ISSUES**](https://github.com/prosemirror/prosemirror/issues) | [**FORUM**](https://discuss.prosemirror.net) | [**GITTER**](https://gitter.im/ProseMirror/prosemirror) | [**CHANGELOG**](https://github.com/ProseMirror/prosemirror/blob/master/CHANGELOG.md) ] | ||
[ [**WEBSITE**](http://prosemirror.net) | [**ISSUES**](https://github.com/prosemirror/prosemirror/issues) | [**FORUM**](https://discuss.prosemirror.net) | [**GITTER**](https://gitter.im/ProseMirror/prosemirror) | [**CHANGELOG**](https://github.com/ProseMirror/prosemirror-model/blob/master/CHANGELOG.md) ] | ||
@@ -5,0 +5,0 @@ This is a [core module](http://prosemirror.net/docs/ref/#model) of [ProseMirror](http://prosemirror.net). |
@@ -377,8 +377,11 @@ import {Fragment} from "./fragment" | ||
value = value.replace(/\s+/g, " ") | ||
// If this starts with whitespace, and there is either no node | ||
// before it or a node that ends with whitespace, strip the | ||
// If this starts with whitespace, and there is no node before it, or | ||
// a hard break, or a text node that ends with whitespace, strip the | ||
// leading space. | ||
if (/^\s/.test(value) && this.open == this.nodes.length - 1) { | ||
let nodeBefore = top.content[top.content.length - 1] | ||
if (!nodeBefore || nodeBefore.isText && /\s$/.test(nodeBefore.text)) | ||
let domNodeBefore = dom.previousSibling | ||
if (!nodeBefore || | ||
(domNodeBefore && domNodeBefore.nodeName == 'BR') || | ||
(nodeBefore.isText && /\s$/.test(nodeBefore.text))) | ||
value = value.slice(1) | ||
@@ -385,0 +388,0 @@ } |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
493299
5963