From: Alexander Ebert Date: Wed, 18 Mar 2015 14:47:30 +0000 (+0100) Subject: Fixed codebox sometimes not recognized in Firefox X-Git-Tag: 2.1.2~34 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=b07bc5323a436024dfe64c1b3057b3d7e5cdce93;p=GitHub%2FWoltLab%2FWCF.git Fixed codebox sometimes not recognized in Firefox --- diff --git a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js index 13f13033d1..52a2c1a48f 100644 --- a/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js +++ b/wcfsetup/install/files/js/3rdParty/redactor/plugins/wbbcode.js @@ -287,16 +287,17 @@ RedactorPlugins.wbbcode = function() { html = html.replace(/…/gi, '\u2026'); html = html.replace(/—/gi, '\u2014'); html = html.replace(/‐/gi, '\u2010'); - + console.debug(html); // preserve code listings var $cachedCodeListings = { }; - html = html.replace(/
\n*
[\s\S]+?
    ([\s\S]+?)<\/ol>\n*<\/div>\n*<\/div>/g, function(match, codeBoxAttributes, lineNumber, codeContent) { + html = html.replace(/\n*
    [\s\S]+?
      ([\s\S]+?)<\/ol>\n*<\/div>\n*<\/div>/g, function(match, codeBoxAttributes1, codeBoxAttributes2, lineNumber, codeContent) { + var $attributes = codeBoxAttributes1 + ' ' + codeBoxAttributes2; var $highlighter = ''; var $filename = ''; - if (codeBoxAttributes.match(/data-highlighter="([a-zA-Z]+)"/)) { + if ($attributes.match(/data-highlighter="([a-zA-Z]+)"/)) { $highlighter = RegExp.$1; } - if (codeBoxAttributes.match(/data-filename="([^"]+)"/)) { + if ($attributes.match(/data-filename="([^"]+)"/)) { $filename = $.trim(RegExp.$1); }