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

datocms-html-to-structured-text

Package Overview
Dependencies
Maintainers
4
Versions
46
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

datocms-html-to-structured-text - npm Package Compare versions

Comparing version 1.1.1 to 1.1.3

9

package.json
{
"name": "datocms-html-to-structured-text",
"version": "1.1.1",
"version": "1.1.3",
"description": "Convert HTML (or a `hast` syntax tree) to a valid DatoCMS Structured Text `dast` document",

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

"dependencies": {
"datocms-structured-text-utils": "^1.1.1",
"datocms-structured-text-utils": "^1.1.3",
"extend": "^3.0.2",

@@ -49,5 +49,6 @@ "hast-util-from-dom": "^3.0.0",

"devDependencies": {
"parse5": "^6.0.1"
"parse5": "^6.0.1",
"unist-util-inspect": "^6.0.0"
},
"gitHead": "0b4259156a7e1fd7eedd947cc668e1ea9c3fcbc7"
"gitHead": "a6d9f3c373026c368400e39e007bfbed1fa8632c"
}

@@ -156,3 +156,3 @@ # `datocms-html-to-structured-text`

allowedMarks: Mark[];
// Properties in this object are avaliable to every handler as Context
// Properties in this object are available to every handler as Context
// is not deeply cloned.

@@ -231,2 +231,3 @@ global: GlobalContext;

const body = find(tree, (node) => node.tagName === 'body');
visit(body, (node, index, parents) => {

@@ -242,2 +243,3 @@ if (

// remove image
const imgParent = parents[parents.length - 1];

@@ -266,2 +268,4 @@ imgParent.children.splice(index, 1);

let nodeInserted = false;
// If we reached the 'div' add the image's node

@@ -272,2 +276,4 @@ if (i === 1) {

liftedImages.add(node);
nodeInserted = true;
}

@@ -284,7 +290,9 @@

}
// Remove the parent if empty
if (parent.children.length === 0) {
splitChildrenIndex -= 1;
parentsParent.children.splice(splitChildrenIndex, 1);
parentsParent.children.splice(
nodeInserted ? splitChildrenIndex - 1 : splitChildrenIndex,
1,
);
}

@@ -291,0 +299,0 @@ }

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