marked icon indicating copy to clipboard operation
marked copied to clipboard

BREAKING CHANGE: allow async option to dictate type returned

Open UziTech opened this issue 1 year ago • 1 comments

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

  • [x] 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.

UziTech avatar Jun 23 '24 06:06 UziTech

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

vercel[bot] avatar Jun 23 '24 06:06 vercel[bot]

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.

vercel[bot] avatar Jul 19 '24 07:07 vercel[bot]

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

UziTech avatar Jul 31 '24 05:07 UziTech