Skip to content

Commit 00c7bf6

Browse files
committed
Task notes - fix opening URLs in new window
Add the target="_blank" back to the <a> that is stripped out by DOMPurify. Set rel="nofollow noopener noreferrer" to harden against reverse tabnabbing Signed-off-by: 4oo4 <4oo4@users.noreply.github.com> Assisted-by: Claude:claude-opus-4-8
1 parent e6fe6f4 commit 00c7bf6

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/components/AppSidebar/NotesItem.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ export default {
8282
.use(Mila, {
8383
attrs: {
8484
target: '_blank',
85-
rel: 'nofollow',
85+
rel: 'nofollow noopener noreferrer',
8686
},
8787
})
8888
.use(Mitl)
@@ -104,7 +104,7 @@ export default {
104104
this.$refs.note__viewer.textContent = val.slice(0, MAX_NOTE_RENDER_SIZE)
105105
return
106106
}
107-
this.$refs.note__viewer.innerHTML = DOMPurify.sanitize(this.md.render(val))
107+
this.$refs.note__viewer.innerHTML = DOMPurify.sanitize(this.md.render(val), { ADD_ATTR: ['target'] })
108108
})
109109
},
110110
},

0 commit comments

Comments
 (0)