summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/lib/html.js11
1 files changed, 6 insertions, 5 deletions
diff --git a/js/lib/html.js b/js/lib/html.js
index ce9b836..26c677b 100644
--- a/js/lib/html.js
+++ b/js/lib/html.js
@@ -228,15 +228,16 @@ var renderNodes = function(block, options) {
};
var sub = function(s) {
- if (s === '&') {
+ switch (s) {
+ case '&':
return '&';
- } else if (s === '<') {
+ case '<':
return '&lt;';
- } else if (s === '>') {
+ case '>':
return '&gt;';
- } else if (s === '"') {
+ case '"':
return '&quot;';
- } else {
+ default:
return s;
}
};