zpin-templates
Advanced tools
Comparing version 0.0.27 to 0.0.28
@@ -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); |
{ | ||
"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); |
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
278841
3737
11
+ Addedparse5@^3.0.1
+ Added@types/node@22.9.0(transitive)
+ Addedparse5@3.0.3(transitive)
+ Addedundici-types@6.19.8(transitive)