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

www(fix): update line height for newlines in code blocks #21711

Merged
merged 1 commit into from
Feb 28, 2020

Conversation

gillkyle
Copy link
Contributor

Description

This PR adds some styles to how Prism renders empty lines so that our code blocks are more readable.

Here's how it looks on the left, compared to what .org shows on the right:

Screen Shot 2020-02-24 at 5 08 52 PM

The code blocks in the docs have newlines so clicking the copy button accurately copies the code with line breaks preserved, but when rendered there is an element created by Prism with no content inside. By giving it a minimum height and updating it's display property it pushes the content below it down to display like the code is represented in reality.

Related Issues

None (that I know of), noticed this problem a while ago

@gillkyle gillkyle requested a review from a team as a code owner February 25, 2020 00:12
Copy link
Contributor

@fk fk left a comment

Choose a reason for hiding this comment

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

🙏 🙏 🙏

Can you remember this working as it should at some point? 😨

@gillkyle
Copy link
Contributor Author

I don't remember when this was last working, it's been like this for a while 😬

@LekoArts LekoArts merged commit fd86047 into master Feb 28, 2020
@LekoArts LekoArts deleted the code-block-newlines branch February 28, 2020 13:41
@muescha
Copy link
Contributor

muescha commented Feb 29, 2020

FYI:
there is a similar PR for adding   for empty lines to get them displayed

#18719 Highlight empty lines without breaking line numbering or hiding them

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.

4 participants