MCPcopy
hub / github.com/Justineo/github-hovercard / fixRef

Function fixRef

src/hovercard.js:1011–1021  ·  view source on GitHub ↗
(elem, base, branch)

Source from the content-addressed store, hash-verified

1009 }
1010
1011 function fixRef(elem, base, branch) {
1012 ['href', 'src'].forEach(attr => {
1013 let src = elem.attr(attr)
1014 if (src && src.indexOf('//') === -1 && src.indexOf('mailto:') === -1) {
1015 if (src.endsWith('.svg')) {
1016 src += '?sanitize=true'
1017 }
1018 elem.attr(attr, `${base}/raw/${branch}/${src}`)
1019 }
1020 })
1021 }
1022
1023 function getHovercardSubject() {
1024 let [type, id] = (

Callers 1

requestFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected