From e6140c32a8e6316d7da5582218e0787f64e4ed72 Mon Sep 17 00:00:00 2001 From: hole-thu Date: Thu, 25 Aug 2022 21:21:54 +0800 Subject: [PATCH] feat: link for image --- src/Common.js | 34 ++++++++++++++++++++-------------- 1 file changed, 20 insertions(+), 14 deletions(-) diff --git a/src/Common.js b/src/Common.js index 07cb9a36..f9e48c78 100644 --- a/src/Common.js +++ b/src/Common.js @@ -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 ( - - {node.alt} - + + + {node.alt} + + ); }, },