mirror of
				https://github.com/TeamPiped/Piped.git
				synced 2025-11-03 22:21:55 +00:00 
			
		
		
		
	Don't replace timestamp's text in description.
This commit is contained in:
		@@ -380,7 +380,10 @@ export default {
 | 
			
		||||
 | 
			
		||||
                        const parser = new DOMParser();
 | 
			
		||||
                        const xmlDoc = parser.parseFromString(this.video.description, "text/html");
 | 
			
		||||
                        xmlDoc.querySelectorAll("a").forEach(elem => (elem.outerHTML = elem.getAttribute("href")));
 | 
			
		||||
                        xmlDoc.querySelectorAll("a").forEach(elem => {
 | 
			
		||||
                            if (!elem.innerText.match(/(?:[\d]{1,2}:)?(?:[\d]{1,2}):(?:[\d]{1,2})/))
 | 
			
		||||
                                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")
 | 
			
		||||
 
 | 
			
		||||
@@ -177,6 +177,7 @@ const mixin = {
 | 
			
		||||
            const emailRegex = /([\w-\\.]+@(?:[\w-]+\.)+[\w-]{2,4})/g;
 | 
			
		||||
            return string
 | 
			
		||||
                .replace(urlRegex, url => {
 | 
			
		||||
                    if (url.endsWith("</a>")) return url;
 | 
			
		||||
                    return `<a href="${url}" target="_blank">${url}</a>`;
 | 
			
		||||
                })
 | 
			
		||||
                .replace(emailRegex, email => {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user