From 1e9e1a1fdc260bd8a19fa5d244590dabb5dfd7f5 Mon Sep 17 00:00:00 2001 From: Jermolene Date: Fri, 20 Feb 2015 16:09:38 +0000 Subject: [PATCH] Single quotes should be HTML encoded As raised here: https://groups.google.com/d/topic/tiddlywiki/nYvgcImvBt8/discussion --- core/modules/utils/utils.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index f27e6ae98..80167d4ab 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -363,10 +363,10 @@ exports.getRelativeDate = function(delta) { }; }; -// Convert & to "&", < to "<", > to ">" and " to """ +// Convert & to "&", < to "<", > to ">", " to """ ' to "'" exports.htmlEncode = function(s) { if(s) { - return s.toString().replace(/&/mg,"&").replace(//mg,">").replace(/\"/mg,"""); + return s.toString().replace(/&/mg,"&").replace(//mg,">").replace(/\"/mg,""").replace(/\'/mg,"'"); } else { return ""; }