Skip to content

fix codeblocks in the document #10119

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

Merged
merged 1 commit into from
Dec 28, 2022
Merged

Conversation

koka831
Copy link
Contributor

@koka831 koka831 commented Dec 25, 2022

While I've looked into #9990, I found broken code blocks in the document.

This patch not only improves visibility, but also fixes a potential bug. When a lint description ends with code block, the string will have three backquotes at the end.
Since the current implementation prints the default value immediately after that, the markdown renderer is unable to properly close the code block.

e.g. arithmetic_side_effects, we can see code block is not rendered properly, and (I think) it's bit hard to understand what "defaults to `[]`" is meant.

2022-12-26_01-51

In this PR, it will be rendered as:

image

changelog: none

r? @xFrednet

This patch not only improves visibility, but also fixes a potential bug.
When a lint description ends with code block, the string will have three
backquotes at the end.
Since the current implementation prints the default value immediately
after that, the markdown renderer is unable to properly close the code
block.
@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Dec 25, 2022
@koka831 koka831 changed the title Place default values near its definitions fix codeblocks in the document Dec 25, 2022
@xFrednet
Copy link
Member

Hey, thank you for change. That example lint description looks interesting? I'm happy that this PR will fix it.

@bors r+

@bors
Copy link
Contributor

bors commented Dec 28, 2022

📌 Commit fae19a9 has been approved by xFrednet

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Dec 28, 2022

⌛ Testing commit fae19a9 with merge 266eef7...

@xFrednet
Copy link
Member

@koka831

I think it's bit hard to understand what "defaults to []" is meant.

Maybe, do you have a suggestion, how this can be expressed better? 🙃

@bors
Copy link
Contributor

bors commented Dec 28, 2022

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: xFrednet
Pushing 266eef7 to master...

@bors bors merged commit 266eef7 into rust-lang:master Dec 28, 2022
@koka831 koka831 deleted the doc/config-default-value branch December 28, 2022 14:10
@koka831
Copy link
Contributor Author

koka831 commented Dec 28, 2022

@xFrednet thank you for the review!

I think it's bit hard to understand what "defaults to []" is meant.

sorry, to be clear, I meant by its position.
Since the previous format is like: [key]: some long description (default to [type]) so config key and its default value are bit far apart.

@xFrednet
Copy link
Member

Ah okay, thank you for the clarification!

And you're welcome for the review! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants