Fix markdown spoiler (#1176)

* Fix spoiler

* added a explanation

* Updated the TestTextDecoration.test_apply_single_entity

---------

Co-authored-by: = <=>
This commit is contained in:
Nikita 2023-05-13 14:10:15 +03:00 committed by GitHub
parent 68a6c2c192
commit c418689dc1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

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)