@tryghost/kg-mobiledoc-html-renderer
Advanced tools
Comparing version 5.3.1 to 5.3.2
@@ -77,2 +77,15 @@ const SimpleDom = require('simple-dom'); | ||
wrapBlockquoteContentInP(node) { | ||
if (node.firstChild && node.firstChild.tagName === 'P') { | ||
return; | ||
} | ||
const p = this.options.dom.createElement('p'); | ||
while (node.firstChild) { | ||
p.appendChild(node.firstChild); | ||
} | ||
node.appendChild(p); | ||
} | ||
modifyChildren(node) { | ||
@@ -87,2 +100,7 @@ walkDom(node, this.modify.bind(this)); | ||
} | ||
// wrap blockquote content in P tag for emails | ||
if (this.options.target === 'email' && node.nodeType === 1 && node.nodeName === 'BLOCKQUOTE') { | ||
this.wrapBlockquoteContentInP(node); | ||
} | ||
} | ||
@@ -137,3 +155,3 @@ } | ||
// eg. to add ID attributes to heading elements | ||
const modifier = new DomModifier({ghostVersion}); | ||
const modifier = new DomModifier(Object.assign({}, cardOptions, {dom: this.options.dom})); | ||
modifier.modifyChildren(rendered.result); | ||
@@ -140,0 +158,0 @@ |
{ | ||
"name": "@tryghost/kg-mobiledoc-html-renderer", | ||
"version": "5.3.1", | ||
"version": "5.3.2", | ||
"repository": "https://github.com/TryGhost/Koenig/tree/master/packages/kg-mobiledoc-html-renderer", | ||
@@ -30,5 +30,5 @@ "author": "Ghost Foundation", | ||
"devDependencies": { | ||
"c8": "7.10.0" | ||
"c8": "7.11.0" | ||
}, | ||
"gitHead": "596e1f3f0d36c905c5cfdd1da2a2acbcdb4f4add" | ||
"gitHead": "d775807eb5039489e68197b9a2c31ae999499beb" | ||
} |
@@ -39,2 +39,2 @@ # Koenig Mobiledoc Html Renderer | ||
Copyright (c) 2013-2021 Ghost Foundation - Released under the [MIT license](LICENSE). | ||
Copyright (c) 2013-2022 Ghost Foundation - Released under the [MIT license](LICENSE). |
Sorry, the diff of this file is not supported yet
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
7857
137