Skip to content

Commit 4537e01

Browse files
committed
only check shouldDecodeAttr in browser
1 parent 097889f commit 4537e01

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

Diff for: src/platforms/web/util/index.js

+5-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,11 @@ export const isAndroid = UA && UA.indexOf('android') > 0
1313

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

2022
/**
2123
* Query an element selector if it's not an element already.

0 commit comments

Comments
 (0)