1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-06-15 01:49:55 +00:00

Add nbsp handling to htmlDecode

This commit is contained in:
Jermolene 2014-01-12 20:11:51 +00:00
parent 4b000fac72
commit b5d2b79a37

View File

@ -207,10 +207,10 @@ $tw.utils.deepDefaults = function(object /*, sourceObjectList */) {
};
/*
Convert "&amp;" to &, "&lt;" to <, "&gt;" to > and "&quot;" to "
Convert "&amp;" to &, "&nbsp;" to nbsp, "&lt;" to <, "&gt;" to > and "&quot;" to "
*/
$tw.utils.htmlDecode = function(s) {
return s.toString().replace(/&lt;/mg,"<").replace(/&gt;/mg,">").replace(/&quot;/mg,"\"").replace(/&amp;/mg,"&");
return s.toString().replace(/&lt;/mg,"<").replace(/&nbsp;/mg,"\x40").replace(/&gt;/mg,">").replace(/&quot;/mg,"\"").replace(/&amp;/mg,"&");
};
/*