Skip to content

Commit

Permalink
Chore: Improve link detection in the HTML preview
Browse files Browse the repository at this point in the history
  • Loading branch information
axllent committed Sep 5, 2024
1 parent 069967f commit 54a72e8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions server/ui-src/components/message/Message.vue
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ export default {
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]');
[...tooltipTriggerList].map(tooltipTriggerEl => new Tooltip(tooltipTriggerEl))
// delay 0.2s until vue has rendered the iframe content
// delay 0.5s until vue has rendered the iframe content
window.setTimeout(() => {
let p = document.getElementById('preview-html')
if (p && typeof p.contentWindow.document.body == 'object') {
Expand All @@ -193,14 +193,14 @@ export default {
let anchorEl = anchorEls[i]
let href = anchorEl.getAttribute('href')
if (href && href.match(/^http/)) {
if (href && href.match(/^https?:\/\//i)) {
anchorEl.setAttribute('target', '_blank')
}
}
} catch (error) { }
this.resizeIFrames()
}
}, 200)
}, 500)
// html highlighting
window.Prism = window.Prism || {}
Expand Down

0 comments on commit 54a72e8

Please sign in to comment.