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

zpin-templates

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

zpin-templates - npm Package Compare versions

Comparing version 0.0.27 to 0.0.28

7

dist/reactTemplates.js

@@ -9,2 +9,3 @@ 'use strict';

var escodegen = require('escodegen');
var parse5 = require('parse5');
var reactDOMSupport = require('./reactDOMSupport');

@@ -63,2 +64,3 @@ var reactNativeSupport = require('./reactNativeSupport');

var dataBindAttr = "rt-bind";
var htmlNode = "rt-html";
/**

@@ -493,2 +495,7 @@ * @param {Options} options

data.body = '[' + _.compact(children).join(',') + ']';
} else if (node.name === htmlNode) {
// let $ = cheerio.load(node);
console.log(node, parse5.serialize(node));
data.body = '[React.createElement(\'div\',{dangerouslySetInnerHTML:{__html: \'<p id="Test">html</p>\'}})]';
console.log(data.body, _typeof(data.body));
} else {

@@ -495,0 +502,0 @@ data.body = _.template(getTagTemplateString(!hasNonSimpleChildren(node), reactSupport.shouldUseCreateElement(context)))(data);

3

package.json
{
"name": "zpin-templates",
"version": "0.0.27",
"version": "0.0.28",
"description": "Light weight templates for react -> write html get valid react code",

@@ -42,2 +42,3 @@ "main": "index.js",

"optionator": "^0.8.2",
"parse5": "^3.0.1",
"text-table": "^0.2.0"

@@ -44,0 +45,0 @@ },

@@ -6,2 +6,3 @@ 'use strict';

const escodegen = require('escodegen');
const parse5 = require('parse5');
const reactDOMSupport = require('./reactDOMSupport');

@@ -71,2 +72,3 @@ const reactNativeSupport = require('./reactNativeSupport');

const dataBindAttr="rt-bind";
const htmlNode="rt-html";
/**

@@ -507,2 +509,7 @@ * @param {Options} options

data.body = `[${_.compact(children).join(',')}]`;
}else if(node.name === htmlNode){
// let $ = cheerio.load(node);
console.log(node,parse5.serialize(node));
data.body = `[React.createElement('div',{dangerouslySetInnerHTML:{__html: '<p id="Test">html</p>'}})]`;
console.log(data.body,typeof data.body)
} else {

@@ -509,0 +516,0 @@ data.body = _.template(getTagTemplateString(!hasNonSimpleChildren(node), reactSupport.shouldUseCreateElement(context)))(data);

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