Skip to content

Conversation

@Manishearth
Copy link
Contributor

fixes #121

@Manishearth
Copy link
Contributor Author

r? @raphlinus

Copy link
Collaborator

@raphlinus raphlinus left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall looks good, just a couple of points. Thanks for doing the work!

containers: Vec<Container>,
last_line_was_empty: bool,

/// In case we have a broken link/image reference, we can call this callback
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd prefer the naming "link resolver"

/// the provided callback will be called with the reference name,
/// and the returned pair will be used as the link name and title if not
/// None.
pub fn new_with_broken_link_callback(text: &'a str, mut opts: Options,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm curious whether the callback might be a reference rather than a Box, as it's only used for the lifetime of the parser (similar to text).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It could, I didn't want to introduce another lifetime param. But reusing the same one may work.

@Manishearth
Copy link
Contributor Author

ping @raphlinus

@raphlinus
Copy link
Collaborator

Sorry, I was waiting for my initial review to be addressed, and kinda dropped the ball. Do you think this is ready for merge?

@Manishearth
Copy link
Contributor Author

I think so

@Manishearth
Copy link
Contributor Author

Another thing we need is to make the HTML escaping stuff public, but I'll open a separate PR for that.

@raphlinus
Copy link
Collaborator

Ok, I'll merge as is then. Thanks!

@raphlinus raphlinus merged commit e2ff600 into pulldown-cmark:master Feb 15, 2018
@Manishearth Manishearth deleted the link-ref branch February 15, 2018 19:13
@Manishearth
Copy link
Contributor Author

@raphlinus can we get a version bump for this? rust-lang/rust#48274 recently landed so I'd like to incorporate this into rustc

@raphlinus
Copy link
Collaborator

@Manishearth Done. I can do another release when the other stuff has landed.

@Manishearth
Copy link
Contributor Author

Sounds good. I'll have to wait for that since the feature as is can't be used.

Might want to actually do it in a single version bump (or yank)? The other PR is technically a breaking change, but only if there's a version between these two PRs.

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.

Option to insert reference link definitions on demand

2 participants