From 4efc488e1370be72977a2c75f0dbd6e53e691121 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 18 Dec 2013 01:49:12 +0100 Subject: [PATCH] Fixed regex being too greedy --- .../files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js b/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js index b8934d1644..f214a25874 100644 --- a/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js +++ b/wcfsetup/install/files/js/3rdParty/ckeditor/plugins/wbbcode/plugin.js @@ -350,10 +350,10 @@ html = html.replace(/ /gi," "); // [email] - html = html.replace(/([\s\S]+?)<\/a>/gi, '[email=$2]$3[/email]'); + html = html.replace(/]*?href=(["'])mailto:(.+?)\1.*?>([\s\S]+?)<\/a>/gi, '[email=$2]$3[/email]'); // [url] - html = html.replace(/([\s\S]+?)<\/a>/gi, function(match, x, url, text) { + html = html.replace(/]*?href=(["'])(.+?)\1.*?>([\s\S]+?)<\/a>/gi, function(match, x, url, text) { if (url == text) return '[url]' + url + '[/url]'; return "[url='" + url + "']" + text + "[/url]"; @@ -375,7 +375,7 @@ html = html.replace(//gi, '[s]'); html = html.replace(/<\/s>/gi, '[/s]'); - // [sub + // [sub] html = html.replace(//gi, '[sub]'); html = html.replace(/<\/sub>/gi, '[/sub]'); -- 2.20.1