bent10 / marked-extensions

Marked extensions workspace
https://www.npmjs.com/search?q=keywords:stilearning-marked-extensions
MIT License
32 stars 5 forks source link

TypeError occurs when parsing a Markdown document with footnotes after parsing a Markdown document without footnotes using the same Marked object #34

Closed krymtkts closed 9 months ago

krymtkts commented 9 months ago

Description

I found a TypeError occurs when parsing a Markdown document with footnotes after parsing a Markdown document without footnotes using the same Marked object.

Error: making content2 raises error.
description: TypeError: Cannot read properties of undefined (reading 'filter')
Please report this to https://github.com/markedjs/marked.
    at Object.tokenizer (https://cdn.jsdelivr.net/npm/marked-footnote@1.2.1:7:1092)
    at https://cdn.jsdelivr.net/npm/marked@11.1.0:7:22564
    at Array.some (<anonymous>)
    at ne.inlineTokens (https://cdn.jsdelivr.net/npm/marked@11.1.0:7:22548)
    at ne.lex (https://cdn.jsdelivr.net/npm/marked@11.1.0:7:19159)
    at lex (https://cdn.jsdelivr.net/npm/marked@11.1.0:7:18986)
    at oe.parse (https://cdn.jsdelivr.net/npm/marked@11.1.0:7:33689)
    ...

The error does not occur in version 1.2.0.

To Reproduce (⚠️ read below)

Parse a Markdown document with footnotes after parsing a Markdown document without footnotes using the same Marked object.

https://replit.com/@krymtkts/marked-footnote-repro2#index.html

Expected Behavior

No errors occurs.

Actual Behavior

An error occurs.

Additional Information

bent10 commented 9 months ago

The issue has been addressed in v1.2.2 🚀

krymtkts commented 9 months ago

Thanks!