MCPcopy Create free account
hub / github.com/ygs-code/vue / getShouldDecode

Function getShouldDecode

vue.js:15806–15811  ·  view source on GitHub ↗
(href)

Source from the content-addressed store, hash-verified

15804 //检查a标签是否有href 地址,如果有则渲染a标签,如果没有则渲染div标签
15805 // 判断标签属性是否是真正的原生属性
15806 function getShouldDecode(href) {
15807 div = div || document.createElement('div');
15808 div.innerHTML = href ? "<a href=\"\n\"/>" : "<div a=\"\n\"/>";
15809 //html里title属性换行的方法: &#10; <div title="123& #10;456">text</div>
15810 return div.innerHTML.indexOf('&#10;') > 0
15811 }
15812
15813 // #3663: IE encodes newlines inside attribute values while other browsers don't
15814 //IE在属性值中编码换行,而其他浏览器则不会

Callers 1

vue.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected