From bc74c89e7600430d6f00c36b4cb72d73935ffd4c Mon Sep 17 00:00:00 2001 From: Jason Friedrich Date: Thu, 1 Jan 2015 06:45:06 +0100 Subject: [PATCH] Update excerpt helper to properly filter HTML footnotes closes #4741 - updated regexp to properly filter out footnotes without removing too much text - happened only when a link was used before a footnote - old regexp was too 'greedy' and removed regular link together with the footnote - new regexp uses a more specific tag --- core/server/helpers/excerpt.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/server/helpers/excerpt.js b/core/server/helpers/excerpt.js index 020c1a4eb1..1b47572486 100644 --- a/core/server/helpers/excerpt.js +++ b/core/server/helpers/excerpt.js @@ -22,7 +22,7 @@ excerpt = function (options) { /*jslint regexp:true */ excerpt = String(this.html); // Strip inline and bottom footnotes - excerpt = excerpt.replace(/.*?<\/a>/gi, ''); + excerpt = excerpt.replace(/.*?<\/a>/gi, ''); excerpt = excerpt.replace(/
    .*?<\/ol><\/div>/, ''); // Strip other html excerpt = excerpt.replace(/<\/?[^>]+>/gi, '');