diff options
author | John MacFarlane <jgm@berkeley.edu> | 2015-01-12 08:51:56 -0800 |
---|---|---|
committer | John MacFarlane <jgm@berkeley.edu> | 2015-01-12 08:51:56 -0800 |
commit | 692e687412416e14bcf4084e9bc67c92fcdb0057 (patch) | |
tree | c5fbfa1756887f0c1bddba53ee581f5184c2d3bd | |
parent | 4bd3ce58851b0cd332b9d46d56e4e42795636984 (diff) |
Fixed some linter errors.
-rw-r--r-- | js/lib/common.js | 6 | ||||
-rw-r--r-- | js/lib/html.js | 17 | ||||
-rw-r--r-- | js/lib/xml.js | 2 | ||||
-rwxr-xr-x | js/test.js | 2 |
4 files changed, 6 insertions, 21 deletions
diff --git a/js/lib/common.js b/js/lib/common.js index 05640e3..06486d3 100644 --- a/js/lib/common.js +++ b/js/lib/common.js @@ -1,5 +1,7 @@ "use strict"; +/* global unescape */ + var entityToChar = require('./html5-entities.js').entityToChar; var ENTITY = "&(?:#x[a-f0-9]{1,8}|#[0-9]{1,8}|[a-z][a-z0-9]{1,31});"; @@ -35,7 +37,7 @@ var unescapeString = function(s) { var normalizeURI = function(uri) { return encodeURI(unescape(uri)); -} +}; var replaceUnsafeChar = function(s) { switch (s) { @@ -66,5 +68,5 @@ var escapeXml = function(s, preserve_entities) { module.exports = { unescapeString: unescapeString, normalizeURI: normalizeURI, - escapeXml: escapeXml, + escapeXml: escapeXml }; diff --git a/js/lib/html.js b/js/lib/html.js index 3f2c1dd..db87c22 100644 --- a/js/lib/html.js +++ b/js/lib/html.js @@ -225,7 +225,7 @@ var renderNodes = function(block) { break; default: - throw("Unknown node type " + node.t); + throw "Unknown node type " + node.t; } } @@ -233,21 +233,6 @@ var renderNodes = function(block) { return buffer; }; -var replaceUnsafeChar = function(s) { - switch (s) { - case '&': - return '&'; - case '<': - return '<'; - case '>': - return '>'; - case '"': - return '"'; - default: - return s; - } -}; - // The HtmlRenderer object. function HtmlRenderer(options){ return { diff --git a/js/lib/xml.js b/js/lib/xml.js index 79b6957..e8fba6a 100644 --- a/js/lib/xml.js +++ b/js/lib/xml.js @@ -30,7 +30,6 @@ var toTagName = function(s) { var renderNodes = function(block) { var attrs; - var info_words; var tagname; var walker = block.walker(); var event, node, entering; @@ -39,7 +38,6 @@ var renderNodes = function(block) { var disableTags = 0; var indentLevel = 0; var indent = ' '; - var grandparent; var unescapedContents; var container; var selfClosing; @@ -19,7 +19,7 @@ var cursor = { green: escSeq('[0;32m'), red: escSeq('[0;31m'), cyan: escSeq('[0;36m'), - reset: escSeq('[0;30m'), + reset: escSeq('[0;30m') }; var writer = new commonmark.HtmlRenderer(); |