diff --git a/lib/marked.js b/lib/marked.js index 73fc270c50..849907f443 100644 --- a/lib/marked.js +++ b/lib/marked.js @@ -1272,6 +1272,14 @@ Parser.prototype.tok = function() { case 'text': { return this.renderer.paragraph(this.parseText()); } + default: { + var errMsg = 'Token with "' + this.token.type + '" type was not found.'; + if (this.options.silent) { + console.log(errMsg); + } else { + throw new Error(errMsg); + } + } } };