Browse Source

only check shouldDecodeAttr in browser

dev
Evan You 8 years ago
parent
commit
4537e01f0f
  1. 8
      src/platforms/web/util/index.js

8
src/platforms/web/util/index.js

@ -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.

Loading…
Cancel
Save