Marked: TypeError: this.renderer.html is not a function (Error in 0.8.1, OK in 0.8.0)

Created on 19 Mar 2020  路  4Comments  路  Source: markedjs/marked

Describe the bug

Bug in 0.8.1. In version 0.8.0 everything works fine.

(node:17048) UnhandledPromiseRejectionWarning: TypeError: this.renderer.html is not a function
Please report this to https://github.com/markedjs/marked.
    at InlineLexer.output (C:\Users\XYZ\workspace\node_modules\marked\src\InlineLexer.js:85:30)
    at Parser.tok (C:\Users\XYZ\workspace\node_modules\marked\src\Parser.js:97:36)
    at Parser.parse (C:\Users\XYZ\workspace\node_modules\marked\src\Parser.js:47:19)
    at Function.parse (C:\Users\XYZ\workspace\node_modules\marked\src\Parser.js:30:19)
    at marked (C:\Users\XYZ\workspace\node_modules\marked\src\marked.js:103:19)
L1 - broken headings

Most helpful comment

This code leads to the error:

## internal header <!-- internal -->

Anmerkung 2020-03-20 120829

While this code for example works:

* line one
* line two <!-- internal -->
* line three <!-- internal -->
* line four

All 4 comments

What markdown are you sending to marked?

The easiest way for us to debug is to provide a link to a demo that demonstrates the error.

This code leads to the error:

## internal header <!-- internal -->

Anmerkung 2020-03-20 120829

While this code for example works:

* line one
* line two <!-- internal -->
* line three <!-- internal -->
* line four

Thanks! I confirmed this is a regression in 0.8.1 and works correctly in 0.8.0.

Any html comment in a heading causes the error, the simplest markdown being:

# <!---->
Was this page helpful?
0 / 5 - 0 ratings

Related issues

raguay picture raguay  路  4Comments

UziTech picture UziTech  路  4Comments

learykara picture learykara  路  3Comments

samit4me picture samit4me  路  3Comments

chunhei2008 picture chunhei2008  路  3Comments