Skip to content

Commit

Permalink
Merge branch 'jvanbruegge-patch-3' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Swizz committed Jul 8, 2017
2 parents 16bfbcd + c2d85fb commit bb4e440
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ const createTextElement = (text) => !is.text(text) ? undefined : {
const considerSvg = (vnode) => !is.svg(vnode) ? vnode :
fn.assign(vnode,
{ data: fn.omit('props', fn.extend(vnode.data,
{ ns: 'http://www.w3.org/2000/svg', attrs: vnode.data.props }
{ ns: 'http://www.w3.org/2000/svg', attrs: fn.omit('className', fn.extend(vnode.data.props,
{ class: vnode.data.props ? vnode.data.props.className : undefined }
)) }
)) },
{ children: is.undefinedv(vnode.children) ? undefined :
vnode.children.map((child) => considerSvg(child))
Expand Down
4 changes: 2 additions & 2 deletions test/snabbdom-specs/vnode-svg/expected.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

export default (h) => {
return h('svg', {}, [
h('g', {}, [
return h('svg', { attrs: {} }, [
h('g', { attrs: {} }, [
h('circle', {
attrs: { cx: 43.5, cy: 23, r: 5 }
}, [])
Expand Down

0 comments on commit bb4e440

Please sign in to comment.