Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mobiledoc-dom-renderer

Package Overview
Dependencies
Maintainers
2
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mobiledoc-dom-renderer - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

17

lib/dom-renderer.js

@@ -39,6 +39,7 @@ /**

*/
render(mobiledoc, rootElement=utils.createElement('div')) {
render(mobiledoc, rootElement=utils.createElement('div'), cards={}) {
const [markerTypes, sections] = mobiledoc;
this.root = rootElement;
this.markerTypes = markerTypes;
this.cards = cards;

@@ -62,2 +63,6 @@ sections.forEach((section) => this.renderSection(section));

break;
case 10:
rendered = this.renderCardSection(section);
utils.appendChild(this.root, rendered);
break;
default:

@@ -74,2 +79,12 @@ throw new Error('Unimplement renderer for type ' + type);

renderCardSection([type, name, payload]) {
let card = this.cards[name];
if (!card) {
throw new Error(`Cannot render unknown card named ${name}`);
}
let element = utils.createElement('div');
card.display.setup(element, {}, {name}, payload);
return element;
}
renderMarkupSection([type, tagName, markers]) {

@@ -76,0 +91,0 @@ let element = utils.createElement(tagName);

2

package.json
{
"name": "mobiledoc-dom-renderer",
"version": "0.1.4",
"version": "0.1.5",
"description": "Renders Mobiledoc input to DOM output",

@@ -5,0 +5,0 @@ "main": "dist/global/mobiledoc-dom-renderer.js",

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