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: extra blank space rendering in note preview component #2829

Merged
merged 3 commits into from
Apr 8, 2021

Conversation

fluiddot
Copy link
Contributor

@fluiddot fluiddot commented Apr 7, 2021

Fix

Fixes #2828

For rendering extra blank spaces properly in the note-preview component, the div used for rendering the note requires the CSS property white-space to be set to pre. This was already done in a wrapper div but it was being removed from DOM due to this effect.

To solve this, I created a new class for note-preview component that contains white-space: pre-wrap and is set to the parent div. Note that I'm using pre-wrap value because otherwise the content is not properly wrapped.

fix-white-space-issue.mp4

Test

  1. Open a note
  2. Add text
  3. Indent some lines and/or add more than one space between words
  4. Click on history button
  5. Observe that extra blank spaces are properly displayed

Release

Fixed displaying extra blank spaces in history screen

@fluiddot fluiddot added the bug Something isn't working label Apr 7, 2021
@fluiddot fluiddot requested review from sandymcfadden and a team April 7, 2021 16:01
@fluiddot fluiddot self-assigned this Apr 7, 2021
@fluiddot fluiddot changed the title Fix extra blank space rendering in note preview component Fix: extra blank space rendering in note preview component Apr 7, 2021
Copy link
Contributor

@sandymcfadden sandymcfadden left a comment

Choose a reason for hiding this comment

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

This looks good and makes sense to me.
Works well in the revision preview and the markdown preview.

@fluiddot fluiddot added this to the 2.10.0 milestone Apr 8, 2021
@fluiddot fluiddot force-pushed the fix/note-preview-white-space branch from 3b4884d to ec98238 Compare April 8, 2021 16:28
@fluiddot fluiddot merged commit bfa4d94 into develop Apr 8, 2021
@fluiddot fluiddot deleted the fix/note-preview-white-space branch April 8, 2021 16:29
@fluiddot fluiddot restored the fix/note-preview-white-space branch April 12, 2021 13:59
@fluiddot fluiddot deleted the fix/note-preview-white-space branch April 12, 2021 14:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extra blank spaces are not displayed when previewing a note in history screen
2 participants