Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

prosemirror-model

Package Overview
Dependencies
Maintainers
1
Versions
85
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

prosemirror-model - npm Package Compare versions

Comparing version 1.19.2 to 1.19.3

6

CHANGELOG.md

@@ -0,1 +1,7 @@

## 1.19.3 (2023-07-13)
### Bug fixes
Don't apply style parse rules for nodes that are skipped by other parse rules.
## 1.19.2 (2023-05-23)

@@ -2,0 +8,0 @@

2

package.json
{
"name": "prosemirror-model",
"version": "1.19.2",
"version": "1.19.3",
"description": "ProseMirror's document model",

@@ -5,0 +5,0 @@ "type": "module",

@@ -431,21 +431,19 @@ import {Fragment} from "./fragment"

addDOM(dom: DOMNode) {
if (dom.nodeType == 3) {
this.addTextNode(dom as Text)
} else if (dom.nodeType == 1) {
let style = (dom as HTMLElement).getAttribute("style")
if (!style) {
this.addElement(dom as HTMLElement)
} else {
let marks = this.readStyles(parseStyles(style))
if (!marks) return // A style with ignore: true
let [addMarks, removeMarks] = marks, top = this.top
for (let i = 0; i < removeMarks.length; i++) this.removePendingMark(removeMarks[i], top)
for (let i = 0; i < addMarks.length; i++) this.addPendingMark(addMarks[i])
this.addElement(dom as HTMLElement)
for (let i = 0; i < addMarks.length; i++) this.removePendingMark(addMarks[i], top)
for (let i = 0; i < removeMarks.length; i++) this.addPendingMark(removeMarks[i])
}
}
if (dom.nodeType == 3) this.addTextNode(dom as Text)
else if (dom.nodeType == 1) this.addElement(dom as HTMLElement)
}
withStyleRules(dom: HTMLElement, f: () => void) {
let style = dom.getAttribute("style")
if (!style) return f()
let marks = this.readStyles(parseStyles(style))
if (!marks) return // A style with ignore: true
let [addMarks, removeMarks] = marks, top = this.top
for (let i = 0; i < removeMarks.length; i++) this.removePendingMark(removeMarks[i], top)
for (let i = 0; i < addMarks.length; i++) this.addPendingMark(addMarks[i])
f()
for (let i = 0; i < addMarks.length; i++) this.removePendingMark(addMarks[i], top)
for (let i = 0; i < removeMarks.length; i++) this.addPendingMark(removeMarks[i])
}
addTextNode(dom: Text) {

@@ -485,3 +483,3 @@ let value = dom.nodeValue!

addElement(dom: HTMLElement, matchAfter?: ParseRule) {
let name = dom.nodeName.toLowerCase(), ruleID
let name = dom.nodeName.toLowerCase(), ruleID: ParseRule | undefined
if (listTags.hasOwnProperty(name) && this.parser.normalizeLists) normalizeList(dom)

@@ -508,7 +506,10 @@ let rule = (this.options.ruleFromNode && this.options.ruleFromNode(dom)) ||

}
this.addAll(dom)
if (rule && rule.skip) this.addAll(dom)
else this.withStyleRules(dom, () => this.addAll(dom))
if (sync) this.sync(top)
this.needsBlock = oldNeedsBlock
} else {
this.addElementByRule(dom, rule, rule.consuming === false ? ruleID : undefined)
this.withStyleRules(dom, () => {
this.addElementByRule(dom, rule!, rule!.consuming === false ? ruleID : undefined)
})
}

@@ -515,0 +516,0 @@ }

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc