-
Notifications
You must be signed in to change notification settings - Fork 256
Markdown fixes #817
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
base: main
Are you sure you want to change the base?
Markdown fixes #817
Conversation
doc test cannot import cursive?
//! ### Examples | ||
//! | ||
//! ```rust | ||
//! use cursive::utils::markup::markdown::parse; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You might need extern crate cursive_core as cursive;
, so it really just needs cursive_core, but it looks as cursive for users.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks - strange though that I cannot reproduce this locally. I'll try.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You'll need to test with the markdown feature to run these
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it, now I can at least reproduce
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't seem to fix it... it cannot resolve CursiveExt
, and when I remove it, the compiler can't find the run()
method.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CursiveExt
is in a different crate, this might just not be possible. If it's ok I remove the example in the doc comment. I put an Markdown example into the examples folder.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You also don't need to run the cursive app (or even make one), you can focus on parsing the markdown and building the TextView
I set the example in the doc comment to "ignore" - let me know if that's ok for you or of course feel free to change. |
This PR contains Markdown usage samples in the documentation and the examples folder as well as some opinionated fixes to the Markdown handling itself:
>
for easier soft line breaksThe parsing test has been changed to make it easier to find the failing span; it has also been extended to test the new behaviour.
pulldown-cmark
seems to have a bug that always returns an empty title for links. I updated it to version 0.13 in Cargo.toml, but this unfortunately did not change this.