markedjs / marked

A markdown parser and compiler. Built for speed.
https://marked.js.org
Other
32.93k stars 3.38k forks source link

Unable to read titles #3256

Closed UpsylonDev closed 5 months ago

UpsylonDev commented 6 months ago

Marked 12.0.1

We are working on a Vuejs3 application displaying data from Strapi V4.19.1 node 20.12.1 During the build we have a problem with marked : ### Heading level 3 are no reads which displays the following problem:

Error: [vite-ssg] Error on page: /fr/*/news 3786ReferenceError: document is not defined*** [3787](https://)Please report this to https://github.com/markedjs/marked. 3788 at getHeadingId

UziTech commented 6 months ago

Can you share the code you use to initialize and paste markdown? What extensions do you use?

UpsylonDev commented 6 months ago

Yes : partially The MD code is just a title : A simple short news for users : level 1-3 dont worked

My tiltle

And text under it ....

export declare function marked(src: string, options: MarkedOptions & { async: true; }): Promise;

We sanitize the code too with DOMPurify

/**

UziTech commented 6 months ago

Can you share code for the renderer that you pass in?