1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-15 13:35:48 +01:00

Fix dtd generation bug.

This commit is contained in:
Kris Maglione
2011-03-16 01:56:20 -04:00
parent 222ef1c16a
commit ba4b07a593
2 changed files with 8 additions and 6 deletions

View File

@@ -975,9 +975,9 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
},
makeDTD: function makeDTD(obj) unescape(encodeURI(iter(obj)
.map(function ([k, v]) ["<!ENTITY ", k, ' "', String.replace(v == null ? "null" : v, /[&"<%]/g,
function (m) ({ '"': "&quot;", "&": "&amp;", "<": "&lt;", "%": "&#x25;" })[m]),
'">'].join(""))
.map(function ([k, v]) ["<!ENTITY ", k, " '", String.replace(v == null ? "null" : v, /['%]/g,
function (m) ({ "'": "&apos;", "%": "&#x25;" })[m]),
"'>"].join(""))
.join("\n"))),
map: deprecated("iter.map", function map(obj, fn, self) iter(obj).map(fn, self).toArray()),