mirror of
https://github.com/Novaloop-AG/element-x-android.git
synced 2026-10-31 16:22:49 +00:00
Convert markdown to HTML when a caption is edited
Adding or editing a media caption from the plain composer sent the caption as text only: the composer has no HTML to pass, and the media caption edit was built by hand with a null formatted body, so the markdown was never rendered. Sending a caption with the same markdown does render it, because the SDK builds the formatted body there. Build the edit with the SDK's createCaptionEdit, which runs the caption through the same markdown conversion the send path uses.
This commit is contained in:
+2
-1
@@ -75,6 +75,7 @@ import org.matrix.rustcomponents.sdk.PollData
|
||||
import org.matrix.rustcomponents.sdk.SendAttachmentJoinHandle
|
||||
import org.matrix.rustcomponents.sdk.UploadParameters
|
||||
import org.matrix.rustcomponents.sdk.UploadSource
|
||||
import org.matrix.rustcomponents.sdk.createCaptionEdit
|
||||
import org.matrix.rustcomponents.sdk.use
|
||||
import timber.log.Timber
|
||||
import uniffi.matrix_sdk.PaginationStatus
|
||||
@@ -341,7 +342,7 @@ class RustTimeline(
|
||||
formattedCaption: String?,
|
||||
): Result<Unit> = withContext(dispatcher) {
|
||||
runCatchingExceptions<Unit> {
|
||||
val editedContent = EditedContent.MediaCaption(
|
||||
val editedContent = createCaptionEdit(
|
||||
caption = caption,
|
||||
formattedCaption = formattedCaption?.let {
|
||||
FormattedBody(body = it, format = MessageFormat.Html)
|
||||
|
||||
Reference in New Issue
Block a user