diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-01-09 22:30:49 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-01-09 23:17:00 -0800 |
commit | 1f5e01bbacb790f8e1159d91d430e7bc023ffc98 (patch) | |
tree | c4c5e93a9232eb38385ca45949f22a1639d8e526 | |
parent | 977a9dd1cd0e5574799211d697b0889431fc0876 (diff) |
Use a switch instead of if-then-else.
-rw-r--r-- | js/lib/html.js | 11 |
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 '<'; - } else if (s === '>') { + case '>': return '>'; - } else if (s === '"') { + case '"': return '"'; - } else { + default: return s; } }; |