prosemirror-model
Advanced tools
Comparing version 1.16.0 to 1.16.1
@@ -0,1 +1,7 @@ | ||
## 1.16.1 (2021-12-29) | ||
### Bug fixes | ||
Fix a bug in the way whitespace-preservation options were handled in `DOMParser`. | ||
## 1.16.0 (2021-12-27) | ||
@@ -2,0 +8,0 @@ |
{ | ||
"name": "prosemirror-model", | ||
"version": "1.16.0", | ||
"version": "1.16.1", | ||
"description": "ProseMirror's document model", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -295,5 +295,6 @@ import {Fragment} from "./fragment" | ||
function wsOptionsFor(type, preserveWhitespace) { | ||
return (preserveWhitespace ? OPT_PRESERVE_WS : 0) | | ||
(preserveWhitespace === "full" || (preserveWhitespace == null && type && type.whitespace == "pre") ? OPT_PRESERVE_WS_FULL : 0) | ||
function wsOptionsFor(type, preserveWhitespace, base) { | ||
if (preserveWhitespace != null) return (preserveWhitespace ? OPT_PRESERVE_WS : 0) | | ||
(preserveWhitespace === "full" ? OPT_PRESERVE_WS_FULL : 0) | ||
return type && type.whitespace == "pre" ? OPT_PRESERVE_WS | OPT_PRESERVE_WS_FULL : base & ~OPT_OPEN_LEFT | ||
} | ||
@@ -384,3 +385,3 @@ | ||
let topNode = options.topNode, topContext | ||
let topOptions = wsOptionsFor(null, options.preserveWhitespace) | (open ? OPT_OPEN_LEFT : 0) | ||
let topOptions = wsOptionsFor(null, options.preserveWhitespace, 0) | (open ? OPT_OPEN_LEFT : 0) | ||
if (topNode) | ||
@@ -627,3 +628,3 @@ topContext = new NodeContext(topNode.type, topNode.attrs, Mark.none, Mark.none, true, | ||
top.match = top.match && top.match.matchType(type, attrs) | ||
let options = preserveWS == null ? top.options & ~OPT_OPEN_LEFT : wsOptionsFor(type, preserveWS) | ||
let options = wsOptionsFor(type, preserveWS, top.options) | ||
if ((top.options & OPT_OPEN_LEFT) && top.content.length == 0) options |= OPT_OPEN_LEFT | ||
@@ -630,0 +631,0 @@ this.nodes.push(new NodeContext(type, attrs, top.activeMarks, top.pendingMarks, solid, null, options)) |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
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
906993
9294