aboutsummaryrefslogtreecommitdiff
path: root/telegram/formatter
diff options
context:
space:
mode:
Diffstat (limited to 'telegram/formatter')
-rw-r--r--telegram/formatter/formatter.go12
1 files changed, 6 insertions, 6 deletions
diff --git a/telegram/formatter/formatter.go b/telegram/formatter/formatter.go
index 6da8256..a8c94a0 100644
--- a/telegram/formatter/formatter.go
+++ b/telegram/formatter/formatter.go
@@ -40,8 +40,8 @@ var italicRunes = []rune("_")
var strikeRunesMarkdown = []rune("~~")
var strikeRunesXEP0393 = []rune("~")
var codeRunes = []rune("`")
-var preRuneStart = []rune("```\n")
-var preRuneEnd = []rune("\n```")
+var preRunesStart = []rune("```\n")
+var preRunesEnd = []rune("\n```")
var quoteRunes = []rune("> ")
var newlineRunes = []rune("\n")
var doubleNewlineRunes = []rune("\n\n")
@@ -270,10 +270,10 @@ func entityToMarkdown(entity *client.TextEntity, doubledRunes []rune, markupMode
case client.TypeTextEntityTypeCode:
return markupBraces(entity, codeRunes, codeRunes)
case client.TypeTextEntityTypePre:
- return markupBraces(entity, preRuneStart, preRuneEnd)
+ return markupBraces(entity, preRunesStart, preRunesEnd)
case client.TypeTextEntityTypePreCode:
preCode, _ := entity.Type.(*client.TextEntityTypePreCode)
- return markupBraces(entity, []rune("\n```"+preCode.Language+"\n"), codeRunes)
+ return markupBraces(entity, []rune("\n```"+preCode.Language+"\n"), preRunesEnd)
case client.TypeTextEntityTypeBlockQuote:
return quotePrependNewlines(entity, doubledRunes, MarkupModeMarkdown)
case client.TypeTextEntityTypeTextUrl:
@@ -300,10 +300,10 @@ func entityToXEP0393(entity *client.TextEntity, doubledRunes []rune, markupMode
case client.TypeTextEntityTypeCode:
return markupBraces(entity, codeRunes, codeRunes)
case client.TypeTextEntityTypePre:
- return markupBraces(entity, preRuneStart, preRuneEnd)
+ return markupBraces(entity, preRunesStart, preRunesEnd)
case client.TypeTextEntityTypePreCode:
preCode, _ := entity.Type.(*client.TextEntityTypePreCode)
- return markupBraces(entity, []rune("\n```"+preCode.Language+"\n"), codeRunes)
+ return markupBraces(entity, []rune("\n```"+preCode.Language+"\n"), preRunesEnd)
case client.TypeTextEntityTypeBlockQuote:
return quotePrependNewlines(entity, doubledRunes, MarkupModeXEP0393)
case client.TypeTextEntityTypeTextUrl: