mdast-squeeze-paragraphs
Advanced tools
Comparing version 2.1.0 to 2.1.1
11
index.js
@@ -6,12 +6,5 @@ 'use strict'; | ||
ast.children = ast.children.filter(function (node) { | ||
if (node.type != 'paragraph') { | ||
return true; | ||
} | ||
// Remove empty text nodes. | ||
node.children = node.children.filter(function (node) { | ||
return node.type != 'text' || (node.value = node.value.trim()); | ||
return node.type != 'paragraph' || node.children.some(function (node) { | ||
return node.type != 'text' || !/^\s*$/.test(node.value); | ||
}); | ||
return node.children.length; | ||
}); | ||
@@ -18,0 +11,0 @@ |
{ | ||
"name": "mdast-squeeze-paragraphs", | ||
"version": "2.1.0", | ||
"description": "Remove empty paragraphs and whitespace left from other mdast transformations", | ||
"version": "2.1.1", | ||
"description": "Remove empty paragraphs left from other mdast transformations", | ||
"author": "Eugene Sharygin <eush77@gmail.com>", | ||
@@ -6,0 +6,0 @@ "license": "MIT", |
@@ -7,3 +7,3 @@ [![npm](https://nodei.co/npm/mdast-squeeze-paragraphs.png)](https://npmjs.com/package/mdast-squeeze-paragraphs) | ||
Remove empty paragraphs and whitespace left from other [mdast] transformations. | ||
Remove empty paragraphs left from other [mdast] transformations. | ||
@@ -10,0 +10,0 @@ Paragraph is considered empty if it is composed from whitespace characters. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3702
14