8

Leverage itemized blocks to support formatting markdown block quotes by ytmimi ·...

 2 years ago
source link: https://github.com/rust-lang/rustfmt/pull/5160
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Conversation

Copy link

Collaborator

ytmimi commented on Dec 30, 2021

Fixes #5157

Doc comments support markdown, but rustfmt didn't previously assign any
semantic value to leading '> ' in comments. This lead to poor formatting
when using wrap_comments=true.

Now, rustfmt treats block quotes as itemized blocks, which greatly
improves how block quotes are formatted when wrap_comments=true.

Next on my list to look at but not going to get to it tonight. Saw you had quoted quotes in the tests which is good, and also got me wondering if there'd be any utility in a mix like quoted lists or a list of quotes. Might be overkill though considering we really only care about the line start

Copy link

Collaborator

Author

ytmimi commented 6 days ago

I'm definitely happy to keep iterating on this and adding support for quoted lists and lists of quotes. I think to address the original issue that won't be necessary, but If you feel strongly about getting something like that in right now I can surely look into implementing it!

I think to address the original issue that won't be necessary, but If you feel strongly about getting something like that in right now I can surely look into implementing it!

No definitely not strongly. In general I feel like we could benefit from more exhaustive tests, so many times I'll vocalize a suggestion if an idea comes to me while looking at something related, tangential or otherwise.

Not my intent to scope creep though so don't hesitate to push back!

Copy link

Member

@calebcartwright calebcartwright left a comment

LGTM, thank you!

calebcartwright

merged commit 1e78a2b into

rust-lang:master 5 days ago

28 checks passed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Assignees

No one assigned

Labels
None yet
Projects

None yet

Milestone

No milestone

Linked issues

Successfully merging this pull request may close these issues.

2 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK