Skip to content

Commit

Permalink
only check shouldDecodeAttr in browser
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jul 26, 2016
1 parent 097889f commit 4537e01
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/platforms/web/util/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ export const isAndroid = UA && UA.indexOf('android') > 0

// some browsers, e.g. PhantomJS, encodes attribute values for innerHTML
// this causes problems with the in-browser parser.
const div = document.createElement('div')
div.innerHTML = '<div a=">">'
export const shouldDecodeAttr = div.innerHTML.indexOf('&gt;') > 0
export const shouldDecodeAttr = inBrowser ? (function () {
const div = document.createElement('div')
div.innerHTML = '<div a=">">'
return div.innerHTML.indexOf('&gt;') > 0
})() : false

/**
* Query an element selector if it's not an element already.
Expand Down

0 comments on commit 4537e01

Please sign in to comment.