Socket
Socket
Sign inDemoInstall

@tryghost/kg-mobiledoc-html-renderer

Package Overview
Dependencies
Maintainers
12
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@tryghost/kg-mobiledoc-html-renderer - npm Package Compare versions

Comparing version 1.0.0 to 2.0.0

23

lib/mobiledoc-html-renderer.js

@@ -79,16 +79,12 @@ const SimpleDom = require('simple-dom');

render(mobiledoc, version) {
render(mobiledoc, cardOptions = {}) {
const rendererOptions = Object.assign({}, this.options, {cardOptions});
/**
* @deprecated: version 1 === Ghost 1.0 markdown-only mobiledoc
* We keep the version 1 logic till Ghost 3.0 to be able to rollback posts.
*
* version 1 === Ghost 1.0 markdown-only mobiledoc
* version 2 (latest) === Ghost 2.0 full mobiledoc
*/
version = version || 2;
rendererOptions.cardOptions.version = rendererOptions.cardOptions.version || 2;
rendererOptions.cardOptions.target = 'html';
const versionedOptions = Object.assign({}, this.options, {
cardOptions: {version}
});
const renderer = new Renderer(versionedOptions);
const renderer = new Renderer(rendererOptions);
const rendered = renderer.render(mobiledoc);

@@ -111,3 +107,8 @@ const serializer = new SimpleDom.HTMLSerializer(SimpleDom.voidMap);

return serializer.serializeChildren(rendered.result);
const output = serializer.serializeChildren(rendered.result);
// clean up any DOM that could be kept around in our SimpleDom instance
rendered.teardown();
return output;
}

@@ -114,0 +115,0 @@ }

{
"name": "@tryghost/kg-mobiledoc-html-renderer",
"version": "1.0.0",
"version": "2.0.0",
"repository": "https://github.com/TryGhost/Koenig/tree/master/packages/kg-mobiledoc-html-renderer",

@@ -25,3 +25,3 @@ "author": "Ghost Foundation",

},
"gitHead": "a3521a8eddb697c497ea993ba6577a87f64a0c11"
"gitHead": "b4b326712490c098ca67e6ab25a4122212edcbc1"
}
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