nodebb-plugin-youtube-lite
-
I have the regex times adjusted.
with me it runs smoothly on 0.7.1the regular expression is
<a href=".(?:youtube.com/(?:[^/]+/.+/|(?:v|e(?:mbed)?)/|.|.*[?&]v=)|youtu.be/)([^"&?/ ]{11})</a>the following URL will be found in a <A>:
https://www.youtube.com/watch?t=61&v=JozAmXo2bDE
https://www.youtube.com/watch?v=VH2QAMMSL40
http://www.youtube.com/embed/NLqAF9hrVbY
http://youtu.be/NLqAF9hrVbY
http://www.youtube.com/sandalsResorts#p/c/54B8C800269D7C1B/0/FJUvudQsKCMinfos:
https://github.com/ogerly/nodebb-plugin-youtube-lite/blob/master/library.jsBuild software better, together
GitHub is where people build software. More than 100 million people use GitHub to discover, fork, and contribute to over 420 million projects.
GitHub (github.com)
-
edit in library.js
this regex is better:
.....var regularUrl = /<a href="http.?:.*(youtube.com|.*be/|.*embed/|watch?.v=|(\w{11})).?</a>/g;
......
-
@ogerly said:
<a href="http.?:.*(youtube.com|.*be/|.*embed/|watch?. v=|(\w{11})). ?</a>
regex101: youtube link + id +
Regular expression tester with syntax highlighting, explanation, cheat sheet for PHP/PCRE, Python, GO, JavaScript, Java, C#/.NET, Rust.
regex101 (regex101.com)