@orchitech/turndown
Advanced tools
Comparing version 6.0.1-orchi.2 to 6.0.1-orchi.3
@@ -651,12 +651,16 @@ var TurndownService = (function () { | ||
if (!node.isBlock && !(node.isCode && options.preformattedCode)) { | ||
var hasLeading = /^\s/.test(node.textContent); | ||
var hasTrailing = /\s$/.test(node.textContent); | ||
var blankWithSpaces = node.isBlank && hasLeading && hasTrailing; | ||
var edges = node.textContent.match(/^(\s*)[\s\S]*?(\s*)$/); | ||
if (!edges) { | ||
console.log(node); | ||
console.log('textContent: \'' + node.textContent + '\''); | ||
console.log(new Error().stack); | ||
} | ||
var blankWithSpaces = node.isBlank && edges[1] && edges[2]; | ||
if (hasLeading && !isFlankedByWhitespace('left', node, options)) { | ||
leading = ' '; | ||
if (edges[1] && !isFlankedByWhitespace('left', node, options)) { | ||
leading = edges[1]; | ||
} | ||
if (!blankWithSpaces && hasTrailing && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = ' '; | ||
if (!blankWithSpaces && edges[2] && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = edges[2]; | ||
} | ||
@@ -663,0 +667,0 @@ } |
@@ -650,12 +650,16 @@ 'use strict'; | ||
if (!node.isBlock && !(node.isCode && options.preformattedCode)) { | ||
var hasLeading = /^\s/.test(node.textContent); | ||
var hasTrailing = /\s$/.test(node.textContent); | ||
var blankWithSpaces = node.isBlank && hasLeading && hasTrailing; | ||
var edges = node.textContent.match(/^(\s*)[\s\S]*?(\s*)$/); | ||
if (!edges) { | ||
console.log(node); | ||
console.log('textContent: \'' + node.textContent + '\''); | ||
console.log(new Error().stack); | ||
} | ||
var blankWithSpaces = node.isBlank && edges[1] && edges[2]; | ||
if (hasLeading && !isFlankedByWhitespace('left', node, options)) { | ||
leading = ' '; | ||
if (edges[1] && !isFlankedByWhitespace('left', node, options)) { | ||
leading = edges[1]; | ||
} | ||
if (!blankWithSpaces && hasTrailing && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = ' '; | ||
if (!blankWithSpaces && edges[2] && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = edges[2]; | ||
} | ||
@@ -662,0 +666,0 @@ } |
@@ -648,12 +648,16 @@ function extend (destination) { | ||
if (!node.isBlock && !(node.isCode && options.preformattedCode)) { | ||
var hasLeading = /^\s/.test(node.textContent); | ||
var hasTrailing = /\s$/.test(node.textContent); | ||
var blankWithSpaces = node.isBlank && hasLeading && hasTrailing; | ||
var edges = node.textContent.match(/^(\s*)[\s\S]*?(\s*)$/); | ||
if (!edges) { | ||
console.log(node); | ||
console.log('textContent: \'' + node.textContent + '\''); | ||
console.log(new Error().stack); | ||
} | ||
var blankWithSpaces = node.isBlank && edges[1] && edges[2]; | ||
if (hasLeading && !isFlankedByWhitespace('left', node, options)) { | ||
leading = ' '; | ||
if (edges[1] && !isFlankedByWhitespace('left', node, options)) { | ||
leading = edges[1]; | ||
} | ||
if (!blankWithSpaces && hasTrailing && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = ' '; | ||
if (!blankWithSpaces && edges[2] && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = edges[2]; | ||
} | ||
@@ -660,0 +664,0 @@ } |
@@ -654,12 +654,16 @@ (function (global, factory) { | ||
if (!node.isBlock && !(node.isCode && options.preformattedCode)) { | ||
var hasLeading = /^\s/.test(node.textContent); | ||
var hasTrailing = /\s$/.test(node.textContent); | ||
var blankWithSpaces = node.isBlank && hasLeading && hasTrailing; | ||
var edges = node.textContent.match(/^(\s*)[\s\S]*?(\s*)$/); | ||
if (!edges) { | ||
console.log(node); | ||
console.log('textContent: \'' + node.textContent + '\''); | ||
console.log(new Error().stack); | ||
} | ||
var blankWithSpaces = node.isBlank && edges[1] && edges[2]; | ||
if (hasLeading && !isFlankedByWhitespace('left', node, options)) { | ||
leading = ' '; | ||
if (edges[1] && !isFlankedByWhitespace('left', node, options)) { | ||
leading = edges[1]; | ||
} | ||
if (!blankWithSpaces && hasTrailing && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = ' '; | ||
if (!blankWithSpaces && edges[2] && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = edges[2]; | ||
} | ||
@@ -666,0 +670,0 @@ } |
@@ -626,12 +626,16 @@ 'use strict'; | ||
if (!node.isBlock && !(node.isCode && options.preformattedCode)) { | ||
var hasLeading = /^\s/.test(node.textContent); | ||
var hasTrailing = /\s$/.test(node.textContent); | ||
var blankWithSpaces = node.isBlank && hasLeading && hasTrailing; | ||
var edges = node.textContent.match(/^(\s*)[\s\S]*?(\s*)$/); | ||
if (!edges) { | ||
console.log(node); | ||
console.log('textContent: \'' + node.textContent + '\''); | ||
console.log(new Error().stack); | ||
} | ||
var blankWithSpaces = node.isBlank && edges[1] && edges[2]; | ||
if (hasLeading && !isFlankedByWhitespace('left', node, options)) { | ||
leading = ' '; | ||
if (edges[1] && !isFlankedByWhitespace('left', node, options)) { | ||
leading = edges[1]; | ||
} | ||
if (!blankWithSpaces && hasTrailing && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = ' '; | ||
if (!blankWithSpaces && edges[2] && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = edges[2]; | ||
} | ||
@@ -638,0 +642,0 @@ } |
@@ -624,12 +624,16 @@ function extend (destination) { | ||
if (!node.isBlock && !(node.isCode && options.preformattedCode)) { | ||
var hasLeading = /^\s/.test(node.textContent); | ||
var hasTrailing = /\s$/.test(node.textContent); | ||
var blankWithSpaces = node.isBlank && hasLeading && hasTrailing; | ||
var edges = node.textContent.match(/^(\s*)[\s\S]*?(\s*)$/); | ||
if (!edges) { | ||
console.log(node); | ||
console.log('textContent: \'' + node.textContent + '\''); | ||
console.log(new Error().stack); | ||
} | ||
var blankWithSpaces = node.isBlank && edges[1] && edges[2]; | ||
if (hasLeading && !isFlankedByWhitespace('left', node, options)) { | ||
leading = ' '; | ||
if (edges[1] && !isFlankedByWhitespace('left', node, options)) { | ||
leading = edges[1]; | ||
} | ||
if (!blankWithSpaces && hasTrailing && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = ' '; | ||
if (!blankWithSpaces && edges[2] && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = edges[2]; | ||
} | ||
@@ -636,0 +640,0 @@ } |
@@ -630,12 +630,16 @@ (function (global, factory) { | ||
if (!node.isBlock && !(node.isCode && options.preformattedCode)) { | ||
var hasLeading = /^\s/.test(node.textContent); | ||
var hasTrailing = /\s$/.test(node.textContent); | ||
var blankWithSpaces = node.isBlank && hasLeading && hasTrailing; | ||
var edges = node.textContent.match(/^(\s*)[\s\S]*?(\s*)$/); | ||
if (!edges) { | ||
console.log(node); | ||
console.log('textContent: \'' + node.textContent + '\''); | ||
console.log(new Error().stack); | ||
} | ||
var blankWithSpaces = node.isBlank && edges[1] && edges[2]; | ||
if (hasLeading && !isFlankedByWhitespace('left', node, options)) { | ||
leading = ' '; | ||
if (edges[1] && !isFlankedByWhitespace('left', node, options)) { | ||
leading = edges[1]; | ||
} | ||
if (!blankWithSpaces && hasTrailing && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = ' '; | ||
if (!blankWithSpaces && edges[2] && !isFlankedByWhitespace('right', node, options)) { | ||
trailing = edges[2]; | ||
} | ||
@@ -642,0 +646,0 @@ } |
{ | ||
"name": "@orchitech/turndown", | ||
"description": "A library that converts HTML to Markdown", | ||
"version": "6.0.1-orchi.2", | ||
"version": "6.0.1-orchi.3", | ||
"author": "Dom Christie + patches by Orchitech", | ||
@@ -6,0 +6,0 @@ "main": "lib/turndown.cjs.js", |
185198
5478