summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--common/content/modes.js2
-rw-r--r--common/modules/config.jsm4
-rw-r--r--common/modules/options.jsm8
-rw-r--r--common/modules/util.jsm8
4 files changed, 11 insertions, 11 deletions
diff --git a/common/content/modes.js b/common/content/modes.js
index 3f1b997b..c54dded9 100644
--- a/common/content/modes.js
+++ b/common/content/modes.js
@@ -238,7 +238,7 @@ var Modes = Module("modes", {
return <></>;
}
- return rec(roots).toXMLString();
+ return rec(roots);
}
util.timeout(function () {
diff --git a/common/modules/config.jsm b/common/modules/config.jsm
index 33568d76..cc1d245c 100644
--- a/common/modules/config.jsm
+++ b/common/modules/config.jsm
@@ -215,8 +215,8 @@ var ConfigBase = Class("ConfigBase", {
"xmlns.html": "http://www.w3.org/1999/xhtml",
"xmlns.xul": "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul",
- "tag.command-line": '<link topic="command-line">command line</link>',
- "tag.status-line": '<link topic="status-line">status line</link>',
+ "tag.command-line": <link topic="command-line">command line</link>,
+ "tag.status-line": <link topic="status-line">status line</link>,
},
dtdStrings: [
diff --git a/common/modules/options.jsm b/common/modules/options.jsm
index aaa6aba1..9dfecffa 100644
--- a/common/modules/options.jsm
+++ b/common/modules/options.jsm
@@ -756,14 +756,12 @@ 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("."),
- escape(o.type === "string" ? o.defaultValue.replace(/'/g, "''") :
- o.value === true ? "on" :
- o.value === false ? "off" : o.stringDefaultValue)]
+ 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)),
diff --git a/common/modules/util.jsm b/common/modules/util.jsm
index e9a6ec46..d8c973dd 100644
--- a/common/modules/util.jsm
+++ b/common/modules/util.jsm
@@ -1080,9 +1080,11 @@ var Util = Module("Util", XPCOM([Ci.nsIObserver, Ci.nsISupportsWeakReference]),
* @returns {string} The DTD fragment containing entity declaration
* for *obj*.
*/
- makeDTD: function makeDTD(obj) iter(obj)
- .map(function ([k, v]) ["<!ENTITY ", k, " '", String.replace(v == null ? "null" : v, /['%]/g,
- function (m) ({ "'": "&apos;", "%": "&#x25;" })[m]),
+ makeDTD: let (map = { "'": "&apos;", '"': "&quot;", "%": "&#x25;", "&": "&amp;", "<": "&lt;", ">": "&gt;" })
+ function makeDTD(obj) iter(obj)
+ .map(function ([k, v]) ["<!ENTITY ", k, " '", String.replace(v == null ? "null" : typeof v == "xml" ? v.toXMLString() : v,
+ typeof v == "xml" ? /['%]/g : /['"%&<>]/g,
+ function (m) map[m]),
"'>"].join(""))
.join("\n"),