1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-20 18:27:39 +00:00

Don't HTML encode single quotes

They don’t get automatically decoded when the browser reads the
resulting HTML. So, instead, we’ll solve
1e9e1a1fdc by switching to double quotes
for attribute values.
This commit is contained in:
Jermolene
2015-03-21 14:17:42 +00:00
parent 743c325b0d
commit 00f35fe41a
4 changed files with 13 additions and 13 deletions

View File

@@ -363,10 +363,10 @@ exports.getRelativeDate = function(delta) {
};
};
// Convert & to "&amp;", < to "&lt;", > to "&gt;", " to "&quot;" ' to "&#39;"
// Convert & to "&amp;", < to "&lt;", > to "&gt;", " to "&quot;"
exports.htmlEncode = function(s) {
if(s) {
return s.toString().replace(/&/mg,"&amp;").replace(/</mg,"&lt;").replace(/>/mg,"&gt;").replace(/\"/mg,"&quot;").replace(/\'/mg,"&#39;");
return s.toString().replace(/&/mg,"&amp;").replace(/</mg,"&lt;").replace(/>/mg,"&gt;").replace(/\"/mg,"&quot;");
} else {
return "";
}