New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@tiptap/core

Package Overview
Dependencies
Maintainers
4
Versions
343
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tiptap/core - npm Package Compare versions

Comparing version 2.2.0-rc.8 to 2.2.0

4

package.json
{
"name": "@tiptap/core",
"description": "headless rich text editor",
"version": "2.2.0-rc.8",
"version": "2.2.0",
"homepage": "https://tiptap.dev",

@@ -35,3 +35,3 @@ "keywords": [

"devDependencies": {
"@tiptap/pm": "^2.2.0-rc.8"
"@tiptap/pm": "^2.2.0"
},

@@ -38,0 +38,0 @@ "peerDependencies": {

@@ -29,3 +29,3 @@ import { Node as ProseMirrorNode } from '@tiptap/pm/model'

doc.nodesBetween(from, to, (node, pos) => {
if (!node || node.nodeSize === undefined) {
if (!node || node?.nodeSize === undefined) {
return

@@ -32,0 +32,0 @@ }

@@ -0,1 +1,17 @@

const removeWhitespaces = (node: HTMLElement) => {
const children = node.childNodes
for (let i = children.length - 1; i >= 0; i -= 1) {
const child = children[i]
if (child.nodeType === 3 && child.nodeValue && /^(\n\s\s|\n)$/.test(child.nodeValue)) {
node.removeChild(child)
} else if (child.nodeType === 1) {
removeWhitespaces(child as HTMLElement)
}
}
return node
}
export function elementFromString(value: string): HTMLElement {

@@ -5,3 +21,5 @@ // add a wrapper to preserve leading and trailing whitespace

return new window.DOMParser().parseFromString(wrappedValue, 'text/html').body
const html = new window.DOMParser().parseFromString(wrappedValue, 'text/html').body
return removeWhitespaces(html)
}

Sorry, the diff of this file is not supported yet

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

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

Sorry, the diff of this file is not supported yet

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