Merge pull request #1 from aiogram/dev-3.x

merge
This commit is contained in:
mor 2023-05-21 18:00:00 +03:00 committed by GitHub
commit 572dce1ad7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 3 deletions

2
.github/FUNDING.yml vendored
View file

@ -1,2 +1,2 @@
open_collective: aiogram
patreon: aiogram

1
CHANGES/1176.bugfix.rst Normal file
View file

@ -0,0 +1 @@
Fixed the markdown spoiler parser.

View file

@ -233,7 +233,7 @@ class MarkdownDecoration(TextDecoration):
return f"~{value}~"
def spoiler(self, value: str) -> str:
return f"|{value}|"
return f"||{value}||"
def quote(self, value: str) -> str:
return re.sub(pattern=self.MARKDOWN_QUOTE_PATTERN, repl=r"\\\1", string=value)

View file

@ -90,7 +90,7 @@ class TestTextDecoration:
[markdown_decoration, MessageEntity(type="bot_command", offset=0, length=5), "test"],
[markdown_decoration, MessageEntity(type="email", offset=0, length=5), "test"],
[markdown_decoration, MessageEntity(type="phone_number", offset=0, length=5), "test"],
[markdown_decoration, MessageEntity(type="spoiler", offset=0, length=5), "|test|"],
[markdown_decoration, MessageEntity(type="spoiler", offset=0, length=5), "||test||"],
[
markdown_decoration,
MessageEntity(type="custom_emoji", offset=0, length=5, custom_emoji_id="42"),