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

@tiptap/core

Package Overview
Dependencies
Maintainers
4
Versions
331
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.1.15 to 2.1.16

4

package.json
{
"name": "@tiptap/core",
"description": "headless rich text editor",
"version": "2.1.15",
"version": "2.1.16",
"homepage": "https://tiptap.dev",

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

"devDependencies": {
"@tiptap/pm": "^2.1.15"
"@tiptap/pm": "^2.1.16"
},

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

@@ -43,3 +43,2 @@ import {

if (typeof content === 'string') {
content = content.split('\n').map(part => part.trim()).join('') // we need to remove new lines since the parser will add breaks
const parser = DOMParser.fromSchema(schema)

@@ -46,0 +45,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 && !/\S/.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,7 @@ // 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
removeWhitespaces(html)
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