Skip to content
This repository has been archived by the owner on Sep 11, 2024. It is now read-only.

Fix vector-im/riot-web#6523 Emoji rendering destroys paragraphs #1910

Merged

Conversation

MazeChaZer
Copy link

@MazeChaZer MazeChaZer commented May 17, 2018

This regression was probably introduced in
4f4441f and is caused by the fact that
the variable isHtml conflates two different meanings:

  • The event contains an HTML message
  • The event message is displayed using HTML

This is an important difference. Plain text messages that contain
emojies are rendered with an HTML string and thus have to be sanitized
etc. But they must not use the MarkDown CSS styles for HTML messages.

The MarkDown CSS styles include whitespace: normal because HTML events
use <br/>-tags for line breaks. Plain text messages with emojies
obviously don't use <br/>-tags, so these styles must not be applied.

Signed-off-by: Jonas Schürmann jonasschuermann@aol.de

This regression was probably introduced in
4f4441f and is caused by the fact that
the variable `isHtml` conflates two different meanings:

- The event contains an HTML message
- The event message is displayed using HTML

This is an important difference. Plain text messages that contain
emojies are rendered with an HTML string and thus have to be sanitized
etc. But they must not use the MarkDown CSS styles for HTML messages.

The MarkDown CSS styles include `whitespace: normal` because HTML events
use `<br/>`-tags for line breaks. Plain text messages with emojies
obviously don't use `<br/>`-tags, so these styles must not be applied.

Signed-off-by: Jonas Schürmann <jonasschuermann@aol.de>
@MazeChaZer MazeChaZer force-pushed the fix-emoji-line-break-bug branch from 2e19c7d to 4a9f4ba Compare May 17, 2018 18:13
Copy link
Contributor

@lukebarnard1 lukebarnard1 left a comment

Choose a reason for hiding this comment

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

Awesome, thanks very much! 🎉

@lukebarnard1 lukebarnard1 merged commit 3e79c3e into matrix-org:develop May 18, 2018
@MazeChaZer MazeChaZer deleted the fix-emoji-line-break-bug branch May 18, 2018 09:48
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants