Skip to content

Commit

Permalink
Handle [ fragment selector. Fixes #2349 (#2352)
Browse files Browse the repository at this point in the history
* Handle `[` fragment selector. Fix #2349

* Update tests

* Simplify hyperscript function
  • Loading branch information
vrimar authored and dead-claudia committed Jan 7, 2019
1 parent 1aaa2ff commit 39c20bd
Show file tree
Hide file tree
Showing 2 changed files with 207 additions and 194 deletions.
9 changes: 5 additions & 4 deletions render/hyperscript.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,12 @@ function hyperscript(selector) {
var vnode = hyperscriptVnode.apply(1, arguments)

if (typeof selector === "string") {
return execSelector(selectorCache[selector] || compileSelector(selector), vnode)
} else {
vnode.tag = selector
return vnode
vnode.children = Vnode.normalizeChildren(vnode.children)
if (selector !== "[") return execSelector(selectorCache[selector] || compileSelector(selector), vnode)
}

vnode.tag = selector
return vnode
}

module.exports = hyperscript
Loading

0 comments on commit 39c20bd

Please sign in to comment.