Skip to content

Commit 9a522d6

Browse files
authored
Merge pull request #1005 from KostyaTretyak/patch-renderer
Add message: token type cannot be found
2 parents aaca929 + c66cd5e commit 9a522d6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/marked.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1272,6 +1272,14 @@ Parser.prototype.tok = function() {
12721272
case 'text': {
12731273
return this.renderer.paragraph(this.parseText());
12741274
}
1275+
default: {
1276+
var errMsg = 'Token with "' + this.token.type + '" type was not found.';
1277+
if (this.options.silent) {
1278+
console.log(errMsg);
1279+
} else {
1280+
throw new Error(errMsg);
1281+
}
1282+
}
12751283
}
12761284
};
12771285

0 commit comments

Comments
 (0)