diff options
Diffstat (limited to 'markdown.js')
-rw-r--r-- | markdown.js | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/markdown.js b/markdown.js index 3dac757..4b9521f 100644 --- a/markdown.js +++ b/markdown.js @@ -17,6 +17,9 @@ function convertMarkdownToHTML(markdown) { function addBlankTargetToLinks() { const links = document.querySelectorAll('a'); links.forEach(link => { + if (!link.getAttribute('href').startsWith('http') && !link.getAttribute('href').startsWith('https')) { + return; + } link.setAttribute('target', '_blank'); }); }
\ No newline at end of file |