1
0
mirror of https://github.com/gryf/pentadactyl-pm.git synced 2026-02-16 07:55:45 +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

@@ -749,12 +749,14 @@ var Options = Module("options", {
opt.set(opt.globalValue, Option.SCOPE_GLOBAL, true);
}, window);
function escape(str) str.replace(/[<&]/g, function (m) ({ "&": "&amp;", "<": "&lt;" })[m]);
services["dactyl:"].pages["options.dtd"] = function () [null,
util.makeDTD(
iter(([["option", o.name, "default"].join("."),
o.type === "string" ? o.defaultValue.replace(/'/g, "''") :
o.value === true ? "on" :
o.value === false ? "off" : o.stringDefaultValue]
escape(o.type === "string" ? o.defaultValue.replace(/'/g, "''") :
o.value === true ? "on" :
o.value === false ? "off" : o.stringDefaultValue)]
for (o in self)),
([["option", o.name, "type"].join("."), o.type] for (o in self)),