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

scribe-editor

Package Overview
Dependencies
Maintainers
5
Versions
68
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

scribe-editor - npm Package Compare versions

Comparing version 0.1.20 to 0.1.21

2

bower.json

@@ -5,3 +5,3 @@ {

"lodash-amd": "2.4.1",
"scribe-common": "0.0.4"
"scribe-common": "0.0.11"
},

@@ -8,0 +8,0 @@ "devDependencies": {

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

# 0.1.21
* Fix [Don't insert BR in empty non block elements](https://github.com/guardian/scribe/pull/258)
# 0.1.20
* Fix [Don't strip nbsps in the transaction manger](https://github.com/guardian/scribe/pull/257)
# 0.1.19

@@ -2,0 +8,0 @@ * Fix [Release v0.01.18 did not succeed](https://github.com/guardian/scribe/pull/253)

{
"name": "scribe-editor",
"version": "0.1.20",
"version": "0.1.21",
"main": "src/scribe.js",
"dependencies": {
"lodash-amd": "~2.4.1",
"scribe-common": "~0.0.4"
"scribe-common": "~0.0.11"
},

@@ -9,0 +9,0 @@ "devDependencies": {

@@ -20,2 +20,11 @@ define([

function parentHasNoTextContent(node) {
if (element.isCaretPositionNode(node)) {
return true;
} else {
return node.parentNode.textContent.trim() === '';
}
}
function traverse(parentNode) {

@@ -28,5 +37,14 @@ // Instead of TreeWalker, which gets confused when the BR is added to the dom,

function isEmpty(node) {
return node.children.length === 0
|| (node.children.length === 1
&& element.isSelectionMarkerNode(node.children[0]));
if ((node.children.length === 0 && element.isBlockElement(node))
|| (node.children.length === 1 && element.isSelectionMarkerNode(node.children[0]))) {
return true;
}
// Do not insert BR in empty non block elements with parent containing text
if (!element.isBlockElement(node) && node.children.length === 0) {
return parentHasNoTextContent(node);
}
return false;
}

@@ -33,0 +51,0 @@

Sorry, the diff of this file is not supported yet

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