-
Notifications
You must be signed in to change notification settings - Fork 3.4k
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
marked.parseInline() returns string | Promise<string> even when { async: false } #3101
Comments
I think parseInline is actually correct. If an extension sets |
I only use this Why doesn't Any other workaround to not have to do unsafe |
Parse does the same thing. I think the types are wrong there. Unfortunately typescript isn't smart enough to know if an extension sets The way that typescript recommends using typescript in this situation is to use |
Got it, it's a shame that Typescript cannot figure it out. I hoped that it may be something that could be easily fixed. Thanks for the tip, didn't thought I could await a regular string, but that works and I prefer it to having unsafe castings. That way if I add an extension in the future (whatever those are for 😆) it will continue to work. |
Marked version: 10.0.0
Describe the bug
marked.parseInline("markdown", { async: false })
returns astring | Promise<string>
.Expected behavior
marked.parseInline("markdown", { async: false })
should return astring
. This is already the case withmarked.parse("markdown", { async: false })
The text was updated successfully, but these errors were encountered: