Skip to content

Do not lose first newline in message#1140

Open
mnd wants to merge 1 commit into
nextcloud:masterfrom
mnd:multiline-messages
Open

Do not lose first newline in message#1140
mnd wants to merge 1 commit into
nextcloud:masterfrom
mnd:multiline-messages

Conversation

@mnd

@mnd mnd commented Nov 24, 2020

Copy link
Copy Markdown
Contributor

When you create multiline notes like the following in Chromium 86.0.4240.198:

1
2
3

You got the following HTML: 1<div>2</div><div>3</div> without <div>
block around first line. Add newline before first <div>.

This code also valid for IceCat 68.11.0esr where you got
<div>1</div><div>2</div><div>3</div> in same case because final
trim() call will remove leading newlines.

Signed-off-by: Nikolai Merinov nikolai.merinov@member.fsf.org

  • Resolves:
  • Target version: master

Summary

For messages created from Chromium browser I loose first newline in the message. Add a hack to bring it back.
NOTE I'ld prefer a better solution, but I barely familiar with web development and can't understand why chromium behave differently in this place

When you create multiline notes like the following in Chromium 86.0.4240.198:
> 1
> 2
> 3
You got the following HTML: "1<div>2</div><div>3</div>" without "<div>"
block around first line. Add newline before first "<div>".

This code also valid for IceCat 68.11.0esr where you got
"<div>1</div><div>2</div><div>3</div>" in same case because final
trim() call will remove leading newlines.

Signed-off-by: Nikolai Merinov <nikolai.merinov@member.fsf.org>
@ArtificialOwl

Copy link
Copy Markdown
Member

let's ping @StCyr @violoncelloCH @icewind1991

@mnd

mnd commented Dec 4, 2020

Copy link
Copy Markdown
Contributor Author

My own recommendation is to reject this pull request, but I wanted to spot the place with an issue.

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