From ec1ec958c6bd8d215c0b5bfec934d94fa6a21cd0 Mon Sep 17 00:00:00 2001 From: Tom <40272218+Jihakuz@users.noreply.github.com> Date: Tue, 1 Mar 2022 09:56:27 +0000 Subject: [PATCH] Make URLs in video description links (#863) * urlify description * changed to div * Move urlify function away from rendering. Co-authored-by: Tom Flux Co-authored-by: FireMasterK <20838718+FireMasterK@users.noreply.github.com> --- src/components/WatchVideo.vue | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/components/WatchVideo.vue b/src/components/WatchVideo.vue index 0bb080cf..91d546bd 100644 --- a/src/components/WatchVideo.vue +++ b/src/components/WatchVideo.vue @@ -89,7 +89,7 @@ v-t="`actions.${showDesc ? 'minimize_description' : 'show_description'}`" /> -

+

(elem.outerHTML = elem.getAttribute("href"))); + xmlDoc.querySelectorAll("br").forEach(elem => (elem.outerHTML = "\n")); + this.video.description = this.urlify(xmlDoc.querySelector("body").innerHTML) .replaceAll(/(?:http(?:s)?:\/\/)?(?:www\.)?youtube\.com(\/[/a-zA-Z0-9?=&]*)/gm, "$1") .replaceAll( /(?:http(?:s)?:\/\/)?(?:www\.)?youtu\.be\/(?:watch\?v=)?([/a-zA-Z0-9?=&]*)/gm,