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

fix: allow async option to dictate type returned #3341

Merged
merged 3 commits into from
Aug 7, 2024

Conversation

UziTech
Copy link
Member

@UziTech UziTech commented Jun 23, 2024

Marked version: v13

Description

BREAKING CHANGE: throw an error if async: false is sent with parse options when using an async extension.

This allows us to overload the parse method when the async option is set.

const html: Promise<string> = marked.parse(md, { async: true });
const html: string = marked.parse(md, { async: false});
const html: Promise<string> | string = marked.parse(md);

closes #3116

Contributor

  • Test(s) exist to ensure functionality and minimize regression (if no tests added, list tests covering this PR); or,
  • no tests required for this PR.
  • If submitting new feature, it has been documented in the appropriate places.

Committer

In most cases, this should be a different person than the contributor.

Copy link

vercel bot commented Jun 23, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
marked-website ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jul 28, 2024 6:00pm

Copy link

vercel bot commented Jul 19, 2024

Deployment failed with the following error:

The provided GitHub repository does not contain the requested branch or commit reference. Please ensure the repository is not empty.

@UziTech
Copy link
Member Author

UziTech commented Jul 31, 2024

@styfle @calculuschild Can I get an approval to merge this and release marked v14

@UziTech UziTech changed the title BREAKING CHANGE: allow async option to dictate type returned fix: allow async option to dictate type returned Aug 7, 2024
@UziTech UziTech merged commit b5a5004 into markedjs:master Aug 7, 2024
8 checks passed
@UziTech UziTech deleted the marked-async-type branch August 7, 2024 03:31
github-actions bot pushed a commit that referenced this pull request Aug 7, 2024
# [14.0.0](v13.0.3...v14.0.0) (2024-08-07)

### Bug Fixes

* allow async option to dictate type returned ([#3341](#3341)) ([b5a5004](b5a5004))
* Remove useNewRenderer ([#3342](#3342)) ([e64f226](e64f226))

### BREAKING CHANGES

* Remove old renderer
* throw an error if `async: false` is set when an extension sets `async: true`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant