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

Render markdown in room list #2694

Merged

Conversation

onurays
Copy link
Contributor

@onurays onurays commented Jan 18, 2021

Fixes #452

markdown_in_room_list

@onurays onurays requested a review from bmarty January 18, 2021 11:10
@TR-SLimey
Copy link
Contributor

I haven't checked so I don't know if that's the case, but if markdown links are also rendered, they should probably not be clickable in the room list, because clicking on the chat can make you accidentally click on a link.

Copy link
Member

@bmarty bmarty left a comment

Choose a reason for hiding this comment

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

some remarks.
Also what about MSGTYPE_EMOTE ? This is maybe another bug, but you could take the opportunity to also handle emote properly here.

@@ -82,13 +87,13 @@ class DisplayableEventFormatter @Inject constructor(
return simpleFormat(senderName, stringProvider.getString(R.string.sent_a_file), appendAuthor)
}
MessageType.MSGTYPE_TEXT -> {
return if (timelineEvent.isReply()) {
// Skip reply prefix, and show important
Copy link
Member

Choose a reason for hiding this comment

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

Why have you removed this comment?

val body = if (timelineEvent.isReply()) timelineEvent.getTextEditableContent() ?: messageContent.body else messageContent.body
return if (messageContent is MessageTextContent && messageContent.matrixFormattedBody.isNullOrBlank().not()) {
val localFormattedBody = htmlRenderer.get().parse(body) as Document
val renderedBody = htmlRenderer.get().render(localFormattedBody) ?: body
Copy link
Member

Choose a reason for hiding this comment

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

I haven't check, but this maybe introduce some code duplication here.

@bmarty bmarty changed the base branch from develop to feature/bma/markdown_roomlist November 16, 2021 15:50
@bmarty
Copy link
Member

bmarty commented Nov 16, 2021

Will iterate on it on my own branch

@bmarty bmarty merged commit 5e12a34 into feature/bma/markdown_roomlist Nov 16, 2021
@bmarty bmarty deleted the feature/ons/fix_composer_buttons_in_dark branch November 16, 2021 15:50
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.

Render markdown in chat previews
3 participants