From 97a3bd7dae7316ce72faf8e3dd84ae2b17fd95e3 Mon Sep 17 00:00:00 2001 From: benweet Date: Tue, 22 Apr 2014 00:19:26 +0100 Subject: [PATCH] Fixed pagedown performance issue --- public/res/libs/Markdown.Converter.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/public/res/libs/Markdown.Converter.js b/public/res/libs/Markdown.Converter.js index a3829929..5e9de51e 100644 --- a/public/res/libs/Markdown.Converter.js +++ b/public/res/libs/Markdown.Converter.js @@ -333,6 +333,8 @@ else /gm,function(){...}}; */ //text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?.*<\/\2>[ \t]*(?=\n+)\n)/gm, hashElement); + + // The .* is highly CPU consuming and I don't know what it's for (not even in the original showdown lib) text = text.replace(/^(<(p|div|h[1-6]|blockquote|pre|table|dl|ol|ul|script|noscript|form|fieldset|iframe|math)\b[^\r]*?<\/\2>[ \t]*(?=\n+)\n)/gm, hashElement); // Special case just for
. It was easier to make a special case than