Skip to content

Commit 4a8789b

Browse files
author
Jiang Shang
committed
bugfix
1 parent 257da20 commit 4a8789b

File tree

2 files changed

+12
-13
lines changed

2 files changed

+12
-13
lines changed

dist/Parser.js

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,6 @@
88

99
'use strict';
1010

11-
Object.defineProperty(exports, '__esModule', {
12-
value: true
13-
});
14-
1511
var _slicedToArray = (function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i['return']) _i['return'](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError('Invalid attempt to destructure non-iterable instance'); } }; })();
1612

1713
var _createClass = (function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ('value' in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; })();
@@ -278,6 +274,7 @@ var Parser = (function () {
278274
}, {
279275
key: 'makeHtml',
280276
value: function makeHtml(text) {
277+
console.log(this);
281278
var html = this.parse(text);
282279
return this.makeFootnotes(html);
283280
}
@@ -331,6 +328,7 @@ var Parser = (function () {
331328
value: function parse(text) {
332329
var _this = this;
333330

331+
console.log(this.__proto__);
334332
var blocks = this.parseBlock(text, text.split("\n"));
335333
var html = '';
336334

@@ -514,9 +512,9 @@ var Parser = (function () {
514512
value: function parseBlock(text) {
515513
var lines = text.split("\n");
516514
this.blocks = [];
517-
this.current = '';
515+
this.current = 'normal';
518516
this.pos = -1;
519-
console.log(this.specialWhiteList);
517+
console.log(this);
520518
var special = Object.keys(this.specialWhiteList).join("|");
521519
var emptyCount = 0;
522520

@@ -1461,8 +1459,6 @@ var Parser = (function () {
14611459
return Parser;
14621460
})();
14631461

1464-
exports['default'] = Parser;
1465-
14661462
var parser = new Parser();
1467-
console.log(parser.makeHtml('##sdfsfd##'));
1468-
module.exports = exports['default'];
1463+
console.log(parser);
1464+
console.log(parser.makeHtml('##sdfsfd##'));

src/Parser.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function md5(str) {
223223
return temp.toLowerCase()
224224
}
225225

226-
export default class Parser {
226+
class Parser {
227227
constractor () {
228228
this.commonWhiteList = 'kbd|b|i|strong|em|sup|sub|br|code|del|a|hr|small'
229229
this.specialWhiteList = {
@@ -244,6 +244,7 @@ export default class Parser {
244244
* @return string
245245
*/
246246
makeHtml (text) {
247+
console.log(this)
247248
let html = this.parse(text)
248249
return this.makeFootnotes(html)
249250
}
@@ -289,6 +290,7 @@ export default class Parser {
289290
* @return string
290291
*/
291292
parse (text) {
293+
console.log(this.__proto__)
292294
let blocks = this.parseBlock(text, text.split("\n"))
293295
let html = ''
294296

@@ -455,9 +457,9 @@ export default class Parser {
455457
parseBlock (text) {
456458
let lines = text.split("\n")
457459
this.blocks = []
458-
this.current = ''
460+
this.current = 'normal'
459461
this.pos = -1
460-
console.log(this.specialWhiteList)
462+
console.log(this)
461463
let special = Object.keys(this.specialWhiteList).join("|")
462464
let emptyCount = 0
463465

@@ -1119,4 +1121,5 @@ export default class Parser {
11191121
}
11201122

11211123
var parser = new Parser()
1124+
console.log(parser)
11221125
console.log(parser.makeHtml('##sdfsfd##'))

0 commit comments

Comments
 (0)