Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Conversation

@ollpu
Copy link
Collaborator

@ollpu ollpu commented Jul 13, 2025

Edit: #1043 maybe doesn't need a new callback, so this PR doesn't need to be merged separately from #1013.


We want to use the same trait for other callbacks as well, e.g. as in #1013 #1043.

Since there will be more callbacks to override, it makes sense to remove the existing blanket implementation for closures. To keep backwards compatibility with most old use cases, new_with_broken_link_callback uses a new wrapper type.

I tried to move the 'input lifetime from the trait to the callbacks themselves, but I still ran into rust-lang/rust#41078 when trying to pass closures to new_with_broken_link_callback. I guess it's fine as is.

Breaking change, so I created a new release branch.

pulldown-cmark/src/parse.rs Outdated Show resolved Hide resolved
Remove blanket impl of ParserCallbacks for closures. Replaced with a
wrapper type BrokenLinkCallback to support the old API.
ollpu added a commit to ollpu/pulldown-cmark that referenced this pull request Sep 10, 2025
No measurable performance impact in a quick benchmark:
pulldown-cmark#1049 (comment)
@ollpu ollpu force-pushed the rename-parser-callbacks branch from b06e968 to b880cb7 Compare September 10, 2025 16:16
No measurable performance impact in a quick benchmark:
pulldown-cmark#1049 (comment)
@ollpu ollpu force-pushed the rename-parser-callbacks branch from b880cb7 to 9c7b81a Compare September 10, 2025 16:20
@ollpu ollpu requested a review from notriddle September 10, 2025 16:22
@ollpu ollpu changed the base branch from branch-0.14 to master November 15, 2025 15:10
@ollpu
Copy link
Collaborator Author

ollpu commented Nov 15, 2025

I'll go ahead and merge this with @notriddle's (slightly stale) review unless there are any objections

@ollpu ollpu merged commit a574ea8 into pulldown-cmark:main Nov 21, 2025
6 checks passed
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.

2 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.