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

Improve whitespace in diagnostics popup #167

Closed
wants to merge 5 commits into from
Closed

Improve whitespace in diagnostics popup #167

wants to merge 5 commits into from

Conversation

braver
Copy link
Contributor

@braver braver commented Oct 8, 2017

Fixes #105

Currently, descriptive text just sits in the parent element and cannot be targeted with CSS without also affecting code snippets. This PR solves that by wrapping it in a div.text.

However, if there is a newline between divs it is rendered as a blank line. This shouldn’t happen in regular HTML or Markdown, but this isn’t regular. This causes two problems:

  1. A disproportionate amount of white space between code snippets and text. This is solved by shifting text half a line upwards, making it sit nicely centered vertically.
  2. Succeeding lines have a blank line between them. This isn’t terrible, but it wasn’t there before the PR, so I solved it by removing the \n before a div. Fenced Code blocks should be followed by a newline so that’s ensured when the block is added.

I had a little side-issue with any text after a \r\n not being rendered. I dunno why, also don’t know why there would be a \r\n, must be something to do with TypeScript being a Microsoft thing and giving us Windows line endings or something. It also caused double newlines to not be respected. I solved that by converting \r\n to \n.

Content in a div.text is now also rendered with a sans-serif font.

Before
screen shot 2017-10-08 at 18 32 56

After
screen shot 2017-10-08 at 20 01 56

PS. My fork seems a bit messy, I’ll clean that up in a second.

@braver braver closed this Oct 8, 2017
@braver braver deleted the braver-whitespace branch October 8, 2017 19:41
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.

1 participant