fix: regex block-quote line >
This commit is contained in:
parent
167887361c
commit
3d387ed5f8
2 changed files with 7 additions and 1 deletions
|
|
@ -16,6 +16,7 @@ var mdV2SpecialChars = map[rune]bool{
|
|||
'~': true,
|
||||
'`': true,
|
||||
'>': true,
|
||||
'<': true,
|
||||
'#': true,
|
||||
'+': true,
|
||||
'-': true,
|
||||
|
|
@ -46,7 +47,7 @@ var allEntityPatterns = []entityPattern{
|
|||
// expandable block-quote opener **>…
|
||||
{re: regexp.MustCompile(`(?m)\*\*>(?:[^\n]*)`), open: "**>", close: ""},
|
||||
// block-quote line >…
|
||||
{re: regexp.MustCompile(`(?m)>(?:[^\n]*)`), open: ">", close: ""},
|
||||
{re: regexp.MustCompile(`(?m)^>(?:[^\n]*)`), open: ">", close: ""},
|
||||
// custom emoji / timestamp  — must come before plain link
|
||||
{re: regexp.MustCompile(`!\[[^\]]*\]\([^)]*\)`), open: "!", close: ""},
|
||||
// inline URL / user mention […](…)
|
||||
|
|
|
|||
|
|
@ -51,6 +51,11 @@ func Test_markdownToTelegramMarkdownV2(t *testing.T) {
|
|||
input: "*Last update: ~10 24h*",
|
||||
expected: "*Last update: \\~10 24h*",
|
||||
},
|
||||
{
|
||||
name: "",
|
||||
input: "<Market Capitalization>",
|
||||
expected: "\\<Market Capitalization\\>",
|
||||
},
|
||||
}
|
||||
|
||||
for _, tc := range cases {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue