summaryrefslogtreecommitdiff
path: root/public/js/extra.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/extra.js')
-rw-r--r--public/js/extra.js6
1 files changed, 4 insertions, 2 deletions
diff --git a/public/js/extra.js b/public/js/extra.js
index d6bbb0c6..dd264047 100644
--- a/public/js/extra.js
+++ b/public/js/extra.js
@@ -570,7 +570,9 @@ export function postProcess (code) {
$(value).html(html)
})
// link should open in new window or tab
- result.find('a:not([href^="#"]):not([target])').attr('target', '_blank')
+ // also add noopener to prevent clickjacking
+ // See details: https://mathiasbynens.github.io/rel-noopener/
+ result.find('a:not([href^="#"]):not([target])').attr('target', '_blank').attr('rel', 'noopener')
// update continue line numbers
const linenumberdivs = result.find('.gutter.linenumber').toArray()
for (let i = 0; i < linenumberdivs.length; i++) {
@@ -832,7 +834,7 @@ const anchorForId = id => {
const anchor = document.createElement('a')
anchor.className = 'anchor hidden-xs'
anchor.href = `#${id}`
- anchor.innerHTML = '<span class="octicon octicon-link"></span>'
+ anchor.innerHTML = '<i class="fa fa-link"></i>'
anchor.title = id
return anchor
}