From 6ca9151eb27dfdec0300e60dedbce4af246b4fba Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Sun, 8 Mar 2015 19:19:43 +0300 Subject: [PATCH 1/2] fix apostrophe in URLs (currently it is displayed as ') --- js/twister_formatpost.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index 5e271c9..c524a3f 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -208,7 +208,7 @@ function htmlFormatMsg( msg, output, mentions ) { if( space != -1 ) url = tmp.substring(0,space); else url = tmp; if( url.length ) { msg = tmp.substr(String(url).length); - url = url.replace(/&/g, '&'); + url = reverseHtmlEntities(url); var extLinkTemplate = $("#external-page-link-template").clone(true); extLinkTemplate.removeAttr("id"); From cd06996b629e3bfd7ca1550c8f0c0a8530c26010 Mon Sep 17 00:00:00 2001 From: Denis Ryabov Date: Sun, 8 Mar 2015 20:46:35 +0300 Subject: [PATCH 2/2] & should be reversed last (to correctly transform "&lt;" to "<" and not to "<") --- js/twister_formatpost.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/twister_formatpost.js b/js/twister_formatpost.js index c524a3f..53026c8 100644 --- a/js/twister_formatpost.js +++ b/js/twister_formatpost.js @@ -342,10 +342,10 @@ function escapeHtmlEntities(str) { function reverseHtmlEntities(str) { return str - .replace(/&/g, '&') .replace(/</g, '<') .replace(/>/g, '>') .replace(/"/g, '"') - .replace(/'/g, "'"); + .replace(/'/g, "'") + .replace(/&/g, '&'); }