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

Fix hiding of empty boring lines #1088

Merged
merged 4 commits into from
Nov 7, 2019
Merged

Conversation

benediktwerner
Copy link
Contributor

#1065 introduced a regression where lines in a playpen starting with # but nothing after that are now not hidden anymore. This PR fixes that regression and also adds a test case for this behavior.

@ehuss
Copy link
Contributor

ehuss commented Nov 6, 2019

Attributes also seem to be broken. For example:

#![no_std]
#![warn(deprecated_in_future)]
#![warn(missing_docs)]

This is hiding the attributes, and when you expand they are corrupted by removing the #.

@benediktwerner
Copy link
Contributor Author

Well, as far as I can tell this also wasn't handled properly in the old code and only happened by "accident" because macros are but into a <span> by syntax highlighting and the line then doesn't start with a # anymore but now the lines get hidden before syntax highlighting. I think the correct way has always been to use ##![no_std] which then gets converted to a #![no_std] and stays visible.

But I now changed it so that it doesn't hide lines starting with #! or #[.

Copy link
Contributor

@ehuss ehuss left a comment

Choose a reason for hiding this comment

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

Thank you!!

@ehuss ehuss merged commit a9160ac into rust-lang:master Nov 7, 2019
Ruin0x11 pushed a commit to Ruin0x11/mdBook that referenced this pull request Aug 30, 2020
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