Skip to content

Commit

Permalink
Fix interpolation component when there are empty text nodes
Browse files Browse the repository at this point in the history
  • Loading branch information
Demivan committed Sep 6, 2019
1 parent 4e7a15f commit 547cdd1
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/components/interpolation.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,12 @@ function onlyHasDefaultPlace (params) {

function useLegacyPlaces (children, places) {
const params = places ? createParamsFromPlaces(places) : {}

// Filter empty text nodes
children = (children || []).filter(child => {
return child.tag || (child.text = child.text.trim())
})

if (!children) { return params }

const everyPlace = children.every(vnodeHasPlaceAttribute)
Expand Down

0 comments on commit 547cdd1

Please sign in to comment.