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

feat: angle brackets if link paren is unbalanced #87

Merged
merged 2 commits into from
Oct 16, 2024

Conversation

notriddle
Copy link
Contributor

No description provided.

@notriddle notriddle force-pushed the notriddle/link-tweaks branch from e538fa4 to 2638216 Compare October 15, 2024 23:57
Copy link
Owner

@Byron Byron left a comment

Choose a reason for hiding this comment

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

That's great work!

Particularly the switch to the TextMergeStream has a stunning effect. It's surprising the text-event splitting done otherwise changes the output so much, so I must wonder if this hints at a defect in this crate. From the looks of it the kind of processing the stream does, this crate could do too, there is no private API involved I think.

@Byron
Copy link
Owner

Byron commented Oct 16, 2024

And I forgot, why is one commit marked s feat! (breaking change)? This crate uses it only for breaking API changes, which doesn't seem to be the case here.
If it is no breaking change, could you change the commit by removing the !?

And bonus points for a specific unit test so this change isn't 'only' tested by the quite broad stupicat fixture based test.

Thanks again.

@Byron Byron added the question Further information is requested label Oct 16, 2024
@notriddle notriddle changed the title feat!: angle brackets if link paren is unbalanced feat: angle brackets if link paren is unbalanced Oct 16, 2024
Increases passing spec tests from 473 to 477.
This increases the amount of passing tests to 578.
It doesn't strictly improve the quality of implementation,
but since separate text events aren't supposed to be semantic,
these failures seem spurrious.
@notriddle notriddle force-pushed the notriddle/link-tweaks branch from 2638216 to b3d7df2 Compare October 16, 2024 16:12
@notriddle
Copy link
Contributor Author

notriddle commented Oct 16, 2024

Good catch 👍 The !s have been removed.

As for event-splitting, try running this from the pulldown-cmark repository:

$ cargo run --example events
lucky*star
 
lucky\*star
"lucky*star\n\nlucky\\*star\n" -> [
  Start(Paragraph)
    Text(Borrowed("lucky"))
    Text(Borrowed("*"))
    Text(Borrowed("star"))
  End(Paragraph)
  Start(Paragraph)
    Text(Borrowed("lucky"))
    Text(Borrowed("*star"))
  End(Paragraph)
]

These two paragraphs mean the same thing, but the text events are different. The spec.txt test suite contains a lot of this stuff, because the whole point of the thing is to demonstrate corner cases in CommonMark. To make sure the event stream was identical, we'd need to avoid spurious backslash escapes, even if the library user has edited the event stream to insert their own text nodes with asterisks in them.

Copy link
Owner

@Byron Byron left a comment

Choose a reason for hiding this comment

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

Thanks a lot!

And I (think I) see, the event handling with TeextMergeStream doesn't have to be 'embedded' into this crate.

Now I wonder if this should be documented somewhere, along with explanation when one would want to use the one over the other. I'd be most grateful if this is something you could do, maybe even on the crate-level docs.

@Byron Byron removed the question Further information is requested label Oct 16, 2024
@Byron Byron merged commit 81ac29b into Byron:main Oct 16, 2024
2 checks passed
@Byron
Copy link
Owner

Byron commented Oct 16, 2024

And here is the new release - it turns out there were other breaking changes before it: https://github.com/Byron/pulldown-cmark-to-cmark/releases/tag/v18.0.0

@notriddle notriddle deleted the notriddle/link-tweaks branch October 16, 2024 19:07
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