cmark

My personal build of CMark ✏️

Commit
692e687412416e14bcf4084e9bc67c92fcdb0057
Parent
4bd3ce58851b0cd332b9d46d56e4e42795636984
Author
John MacFarlane <jgm@berkeley.edu>
Date

Fixed some linter errors.

Diffstat

4 files changed, 6 insertions, 21 deletions

Status File Name N° Changes Insertions Deletions
Modified js/lib/common.js 6 4 2
Modified js/lib/html.js 17 1 16
Modified js/lib/xml.js 2 0 2
Modified js/test.js 2 1 1
diff --git 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
@@ -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 '&amp;';
-    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
@@ -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
@@ -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();