X-Git-Url: http://git.giacomolli.uk/onechat/blobdiff_plain/88581c0765be50dcabcc2913c38ae6786c426a3a..8fb85e5647f82e029956d81be29b3a5ac3490636:/telegram.go diff --git a/telegram.go b/telegram.go index 4e2bf7c..f2c687a 100644 --- a/telegram.go +++ b/telegram.go @@ -721,10 +721,10 @@ func telegramRichCut(markdown string, limit int) (int, string, string) { end += start + 1 text := strings.TrimRight(markdown[start:end], "\r\n") - _, opens := telegramCodeFence(text) + _, opens := markdownCodeFence(text) switch { case fence != "": - if telegramClosesFence(text, fence) { + if markdownClosesFence(text, fence) { fence = "" } else if end > len(opening)+1 && end+len(fence)+1 <= limit { code, inFence, inOpening = end, fence, opening