@tryghost/kg-mobiledoc-html-renderer
Advanced tools
Comparing version 5.0.0 to 5.1.0
@@ -120,2 +120,31 @@ const SimpleDom = require('simple-dom'); | ||
// avoid a HR as the first or last element in a post when emailing | ||
if (cardOptions.target === 'email') { | ||
const hrFirstChild = rendered.result.firstChild; | ||
if (hrFirstChild && hrFirstChild.tagName === 'HR') { | ||
rendered.result.removeChild(hrFirstChild); | ||
} | ||
if (hrFirstChild && hrFirstChild.tagName === 'DIV') { | ||
const divFirstChild = hrFirstChild.firstChild; | ||
if (divFirstChild && divFirstChild.tagName === 'HR') { | ||
hrFirstChild.removeChild(divFirstChild); | ||
} | ||
} | ||
const hrLastChild = rendered.result.lastChild; | ||
if (hrLastChild && hrLastChild.tagName === 'HR') { | ||
rendered.result.removeChild(hrLastChild); | ||
} | ||
if (hrLastChild && hrLastChild.tagName === 'DIV') { | ||
const divLastChild = hrLastChild.lastChild; | ||
if (divLastChild && divLastChild.tagName === 'HR') { | ||
hrLastChild.removeChild(divLastChild); | ||
} | ||
} | ||
} | ||
// Walk the DOM output and modify nodes as needed | ||
@@ -122,0 +151,0 @@ // eg. to add ID attributes to heading elements |
{ | ||
"name": "@tryghost/kg-mobiledoc-html-renderer", | ||
"version": "5.0.0", | ||
"version": "5.1.0", | ||
"repository": "https://github.com/TryGhost/Koenig/tree/master/packages/kg-mobiledoc-html-renderer", | ||
@@ -29,3 +29,3 @@ "author": "Ghost Foundation", | ||
}, | ||
"gitHead": "8f888e8f270c466ddafbfbc0b9e36e4b6391e5a7" | ||
"gitHead": "cc742b332f1a02e7d4fbbfe520ff47714151bd24" | ||
} |
7755
136