mirror of
https://github.com/TeamPiped/Piped.git
synced 2025-12-19 19:20:16 +00:00
Properly rewrite channel descriptions
This commit is contained in:
@@ -251,6 +251,15 @@ const mixin = {
|
||||
elem.click();
|
||||
elem.remove();
|
||||
},
|
||||
rewriteDescription(text) {
|
||||
return this.urlify(text)
|
||||
.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,
|
||||
"/watch?v=$1",
|
||||
)
|
||||
.replaceAll("\n", "<br>");
|
||||
},
|
||||
},
|
||||
computed: {
|
||||
authenticated(_this) {
|
||||
|
||||
Reference in New Issue
Block a user