Skip to content

Commit

Permalink
Fix merging plaintext caption with media already including HTML caption
Browse files Browse the repository at this point in the history
  • Loading branch information
tulir committed Jun 12, 2024
1 parent 0ec720c commit 147c31a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion msgconv/from-meta.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ func (cm *ConvertedMessage) MergeCaption() {
mediaContent := cm.Parts[0].Content
textContent := cm.Parts[1].Content
if mediaContent.FileName != "" && mediaContent.FileName != mediaContent.Body {
if textContent.FormattedBody != "" {
if textContent.FormattedBody != "" || mediaContent.FormattedBody != "" {
textContent.EnsureHasHTML()
mediaContent.EnsureHasHTML()
mediaContent.FormattedBody = fmt.Sprintf("%s<br><br>%s", mediaContent.FormattedBody, textContent.FormattedBody)
}
Expand Down

0 comments on commit 147c31a

Please sign in to comment.