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

Newlines fix, add support multiline labels #41

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

GrigoriiTarasov
Copy link

@GrigoriiTarasov GrigoriiTarasov commented Jun 10, 2024

Currently first newline is ignored and 2nd and more breaks background both for content and label (with or without spaces between)

[Pic1 Example from #21 few text old/current version]

This commit adds the argument "newline_mode"
with options:
1) 'old' (default) - As is now: ignores first consequential \n, breaks background on second. Nothing changed.

[Pic2 Lots of text old/current version]

2) 'flex' - Writes all newlines. Background fixed for both label and content. Each annotation is grouped in box having same label on the side (as side effect of display inline-flex preserved)

[Pic3 Few text flex option]

[Pic4 Lots of text flex option]

3) 'multiline' - writes all newlines with proper background for content. Lines are preserved (by display inline instead of inline-flex).

[Pic5 Few text multiline option]

[Pic6 Lots of text multiline option]

Default behavior is the old one thus it backward-compatible.
It resolves #21 and gives newline handling in unified and predictable fashion.

@fkdosilovic
Copy link

This would be a great fix for the component. (Just leaving a comment to show the importance of the fix for the community :) ).

Copy link
Collaborator

@blackary blackary left a comment

Choose a reason for hiding this comment

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

LGTM -- what do you think @tvst?

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.

Issue with newline characters
3 participants