- Commit
- 5fbd73cc31627b125c59f98a5de41e6442235ea7
- Parent
- 1db8dd8d674229c102cd5839f56e5e50068fb4be
- Author
- John MacFarlane <jgm@berkeley.edu>
- Date
linter fixes to html5-entities.js and index.js.
My personal build of CMark ✏️
linter fixes to html5-entities.js and index.js.
2 files changed, 8 insertions, 5 deletions
Status | File Name | N° Changes | Insertions | Deletions |
Modified | js/lib/html5-entities.js | 11 | 6 | 5 |
Modified | js/lib/index.js | 2 | 2 | 0 |
diff --git a/js/lib/html5-entities.js b/js/lib/html5-entities.js @@ -2125,9 +2125,10 @@ var entities = { Zscr: 55349, zscr: 55349, zwj: 8205, - zwnj: 8204 } + zwnj: 8204 }; var entityToChar = function(m) { + "use strict"; var isNumeric = /^&#/.test(m); var isHex = /^&#[Xx]/.test(m); var uchar; @@ -2135,15 +2136,15 @@ var entityToChar = function(m) { if (isNumeric) { var num; if (isHex) { - num = parseInt(m.slice(3,-1), 16); + num = parseInt(m.slice(3, -1), 16); } else { - num = parseInt(m.slice(2,-1), 10); + num = parseInt(m.slice(2, -1), 10); } uchar = fromCodePoint(num); } else { - ucode = entities[m.slice(1,-1)]; + ucode = entities[m.slice(1, -1)]; if (ucode) { - uchar = fromCodePoint(entities[m.slice(1,-1)]); + uchar = fromCodePoint(entities[m.slice(1, -1)]); } } return (uchar || m);
diff --git a/js/lib/index.js b/js/lib/index.js @@ -9,6 +9,8 @@ // var renderer = new commonmark.HtmlRenderer(); // console.log(renderer.render(parser.parse('Hello *world*'))); +"use strict"; + var util = require('util'); var renderAST = function(tree) {