Added fancy text to posts and comments

This commit is contained in:
Lars van Hijfte
2017-01-31 13:54:31 +01:00
parent e85a685b0f
commit 794b5ab294
7 changed files with 21 additions and 12 deletions

View File

@@ -3,7 +3,7 @@ var months = ["januari", "februari", "maart", "april", "mei", "juni", "juli", "a
function fancyText(text) {
// Add links, images, gifs and (youtube) video's.
var regex = /(https?:\/\/.[^ ]*)/ig;
var regex = /(https?:\/\/.[^ <>"]*)/ig;
text = text.replace(regex, function(link) {
// Add images
if (link.match(/(https?:\/\/.[^ ]*\.(?:png|jpg|jpeg|gif))/ig)) {