Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue using {sanitize:true} inline #28

Closed
bosung90 opened this issue Aug 23, 2023 · 2 comments
Closed

Issue using {sanitize:true} inline #28

bosung90 opened this issue Aug 23, 2023 · 2 comments

Comments

@bosung90
Copy link

Using following way to sanitize causes runtime error.

     {@html Marked.parse(event.description ?? '', {sanitize: true})}

TypeError: this.options.escape is not a function
Please report this to https://github.com/ts-stack/markdown
at InlineLexer.output (/Users/xxxx/node_modules/@ts-stack/markdown/bundles/ts-stack-markdown.umd.js:797:60)
at Parser.tok (/Users/xxxx/node_modules/@ts-stack/markdown/bundles/ts-stack-markdown.umd.js:930:69)
at Parser.parse (/Users/xxxx/node_modules/@ts-stack/markdown/bundles/ts-stack-markdown.umd.js:894:29)
at Parser.parse (/Users/xxxx/node_modules/@ts-stack/markdown/bundles/ts-stack-markdown.umd.js:887:27)
at Marked.callParser (/Users/xxxx/node_modules/@ts-stack/markdown/bundles/ts-stack-markdown.umd.js:1137:31)
at Marked.parse (/Users/xxxx/node_modules/@ts-stack/markdown/bundles/ts-stack-markdown.umd.js:1078:29)
at eval (/Users/xxxx/src/lib/components/EventCard.svelte:29:1006)
at Object.$$render (/Users/xxxx/node_modules/svelte/src/runtime/internal/ssr.js:174:16)
at Object.default (/Users/xxxx/src/routes/(prerender)/(home)/+page.svelte:93:102)
at eval (/Users/xxxx/src/lib/components/Section.svelte:17:39)

@KostyaTretyak
Copy link
Collaborator

From comments on Marked.parse() method:

Hash of options. They replace, but do not merge with the default options. If you want the merging, you can to do this via Marked.setOptions().

But maybe I'll fix it. Now I don't remember what this behavior was intended for.

@KostyaTretyak
Copy link
Collaborator

Try npm i @ts-stack/markdown. With v1.5.0 this issues fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants