summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--js/lib/common.js6
-rw-r--r--js/lib/html.js17
-rw-r--r--js/lib/xml.js2
-rwxr-xr-xjs/test.js2
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 '&lt;';
- case '>':
- return '&gt;';
- case '"':
- return '&quot;';
- 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;
diff --git a/js/test.js b/js/test.js
index 2e8b5c3..1127f43 100755
--- a/js/test.js
+++ b/js/test.js
@@ -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();