mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
better youtube embeds
This commit is contained in:
parent
b87487ed1f
commit
ff249e0107
5 changed files with 96 additions and 10 deletions
|
@ -78,7 +78,7 @@ export const formatText = (text: string): string =>
|
|||
? ''
|
||||
: text
|
||||
.replace(
|
||||
/(https?:\/\/(www\.)?(youtube\.com|youtu\.be)\/(watch)?(\?v=)?[\w\-]+)/gim,
|
||||
/(https?:\/\/(www\.)?(youtube\.com|youtu\.be)\/(watch)?(\?v=)?[\w\-\&\=]+)/gim,
|
||||
'\n$1\n'
|
||||
)
|
||||
.replace(/\n{1,}/gim, '\n')
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue