|
|
|
@ -140,21 +140,27 @@ export class HighlightedMarkdown extends Component {
|
|
|
|
|
{ |
|
|
|
|
shouldProcessNode: (node) => node.name === 'img', |
|
|
|
|
processNode(node, index) { |
|
|
|
|
const rp = |
|
|
|
|
STORAGE_BASE && node.attribs.src.startsWith(STORAGE_BASE) |
|
|
|
|
? 'origin' |
|
|
|
|
: 'no-referrer'; |
|
|
|
|
return ( |
|
|
|
|
<a |
|
|
|
|
href={normalize_url(node.attribs.src)} |
|
|
|
|
target="_blank" |
|
|
|
|
referrerPolicy={rp} |
|
|
|
|
> |
|
|
|
|
<span className="ext-img__warpper loading"> |
|
|
|
|
<img |
|
|
|
|
src={normalize_url(node.attribs.src)} |
|
|
|
|
alt={node.alt} |
|
|
|
|
className="ext-img" |
|
|
|
|
referrerPolicy={ |
|
|
|
|
STORAGE_BASE && node.attribs.src.startsWith(STORAGE_BASE) |
|
|
|
|
? 'origin' |
|
|
|
|
: 'no-referrer' |
|
|
|
|
} |
|
|
|
|
referrerPolicy={rp} |
|
|
|
|
onError={stop_loading} |
|
|
|
|
onLoad={stop_loading} |
|
|
|
|
/> |
|
|
|
|
</span> |
|
|
|
|
</a> |
|
|
|
|
); |
|
|
|
|
}, |
|
|
|
|
}, |
|
|
|
|