@ebay/ebayui-core
Advanced tools
Comparing version 0.1.1 to 0.1.2
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -13,17 +13,23 @@ /** | ||
var parentTag = el.tagName; | ||
el.body.forEach(function (child) { | ||
var childTag = child.tagName; | ||
// find the matching tag based on the child tag name of | ||
// the children matching the given tagName | ||
if (childTag && childTag.indexOf(parentTag + "-") === 0) { | ||
var outputTag = parentTag + ":" + childTag.slice(parentTag.length + 1); | ||
var nestedTag = context.createNodeForEl(outputTag, child.getAttributes()); | ||
nestedTag.body = child.body; | ||
child.replaceWith(nestedTag); | ||
// walk the tree | ||
var walker = context.createWalker({ | ||
enter: function enter(node) { | ||
var childTag = node.tagName; | ||
// find the matching tag based on the child tag name of | ||
// the children matching the given tagName | ||
if (node.type === 'HtmlElement' && node.tagName.indexOf(parentTag + '-') === 0) { | ||
var outputTag = parentTag + ':' + childTag.slice(parentTag.length + 1); | ||
var nestedTag = context.createNodeForEl(outputTag, node.getAttributes()); | ||
nestedTag.body = node.body; | ||
node.replaceWith(nestedTag); | ||
walker.skip(); | ||
} | ||
} | ||
}); | ||
return child; | ||
}); | ||
walker.walk(el); | ||
} | ||
module.exports = transform; |
{ | ||
"name": "@ebay/ebayui-core", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"scripts": { | ||
@@ -5,0 +5,0 @@ "installMarkoV3": "yarn add marko@^3 marko-widgets@^6 -D", |
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
363987
65
1196