From b07bc5323a436024dfe64c1b3057b3d7e5cdce93 Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Wed, 18 Mar 2015 15:47:30 +0100 Subject: [PATCH] Fixed codebox sometimes not recognized in Firefox --- .../files/js/3rdParty/redactor/plugins/wbbcode.js | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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); } -- 2.20.1