aboutsummaryrefslogtreecommitdiff
path: root/telegram/formatter/formatter.go
diff options
context:
space:
mode:
Diffstat (limited to 'telegram/formatter/formatter.go')
-rw-r--r--telegram/formatter/formatter.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/telegram/formatter/formatter.go b/telegram/formatter/formatter.go
index 8ab4281..6d40720 100644
--- a/telegram/formatter/formatter.go
+++ b/telegram/formatter/formatter.go
@@ -20,6 +20,8 @@ type InsertionStack []*Insertion
var boldRunesMarkdown = []rune("**")
var boldRunesXEP0393 = []rune("*")
var italicRunes = []rune("_")
+var strikeRunesMarkdown = []rune("~~")
+var strikeRunesXEP0393 = []rune("~")
var codeRunes = []rune("`")
var preRuneStart = []rune("```\n")
var preRuneEnd = []rune("\n```")
@@ -133,6 +135,8 @@ func EntityToMarkdown(entity *client.TextEntity) (*Insertion, *Insertion) {
return markupBraces(entity, boldRunesMarkdown, boldRunesMarkdown)
case client.TypeTextEntityTypeItalic:
return markupBraces(entity, italicRunes, italicRunes)
+ case client.TypeTextEntityTypeStrikethrough:
+ return markupBraces(entity, strikeRunesMarkdown, strikeRunesMarkdown)
case client.TypeTextEntityTypeCode:
return markupBraces(entity, codeRunes, codeRunes)
case client.TypeTextEntityTypePre:
@@ -159,6 +163,8 @@ func EntityToXEP0393(entity *client.TextEntity) (*Insertion, *Insertion) {
return markupBraces(entity, boldRunesXEP0393, boldRunesXEP0393)
case client.TypeTextEntityTypeItalic:
return markupBraces(entity, italicRunes, italicRunes)
+ case client.TypeTextEntityTypeStrikethrough:
+ return markupBraces(entity, strikeRunesXEP0393, strikeRunesXEP0393)
case client.TypeTextEntityTypeCode:
// inline code is non-standard
return markupBraces(entity, codeRunes, codeRunes)