Skip to content

Commit

Permalink
fix wix-incubator#190: allow kebab-case names containing more than on…
Browse files Browse the repository at this point in the history
…e '-'
  • Loading branch information
nippur72 committed Sep 5, 2016
1 parent 2878fc0 commit 66d18d0
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/reactTemplates.js
Original file line number Diff line number Diff line change
Expand Up @@ -306,7 +306,7 @@ function convertTagNameToConstructor(tagName, context) {
}
let isHtmlTag = _.includes(reactDOMSupport[context.options.targetVersion], tagName);
if (reactSupport.shouldUseCreateElement(context)) {
isHtmlTag = isHtmlTag || tagName.match(/^\w+(-\w+)$/);
isHtmlTag = isHtmlTag || tagName.match(/^\w+(-\w+)+$/);
return isHtmlTag ? `'${tagName}'` : tagName;
}
return isHtmlTag ? 'React.DOM.' + tagName : tagName;
Expand Down
1 change: 1 addition & 0 deletions test/data/custom-element.rt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<div>
<custom-element></custom-element>
<my-custom-element></my-custom-element>
</div>
2 changes: 1 addition & 1 deletion test/data/custom-element.rt.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<div><custom-element></custom-element></div>
<div><custom-element></custom-element><my-custom-element></my-custom-element></div>

0 comments on commit 66d18d0

Please sign in to comment.