Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | 10x 1x 1x 1x 1x 1x 1x 1x | export default (dom) => function viewAsMbox (obj) { const anchor = dom.createElement('a') // previous implementation assumed email address was Literal. fixed. // FOAF mboxs must NOT be literals -- must be mailto: URIs. let address = obj.termType === 'NamedNode' ? obj.uri : obj.value // this way for now // if (!address) return viewAsBoringDefault(obj) const index = address.indexOf('mailto:') address = index >= 0 ? address.slice(index + 7) : address anchor.setAttribute('href', 'mailto:' + address) anchor.appendChild(dom.createTextNode(address)) return anchor } |