1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 19:44:20 +00:00

Add support for spoilers

This commit is contained in:
Steffo 2022-02-22 04:49:04 +01:00
parent d1a42c15da
commit 40ab542a92
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -11,6 +11,8 @@ def ds_markdown_format(string: str) -> str:
- ``\uE002``: end underline - ``\uE002``: end underline
- ``\uE015``: start strike - ``\uE015``: start strike
- ``\uE005``: end strike - ``\uE005``: end strike
- ``\uE01F``: start spoiler
- ``\uE00F``: end spoiler
- ``\uE01C``: start single-line code - ``\uE01C``: start single-line code
- ``\uE00C``: end single-line code - ``\uE00C``: end single-line code
- ``\uE01D``: start multi-line code - ``\uE01D``: start multi-line code
@ -37,6 +39,8 @@ def ds_markdown_format(string: str) -> str:
string = string.replace("\uE005", "~~") string = string.replace("\uE005", "~~")
string = string.replace("\uE012", "__") string = string.replace("\uE012", "__")
string = string.replace("\uE002", "__") string = string.replace("\uE002", "__")
string = string.replace("\uE01F", "||")
string = string.replace("\uE00F", "||")
string = string.replace("\uE01C", "`") string = string.replace("\uE01C", "`")
string = string.replace("\uE00C", "`") string = string.replace("\uE00C", "`")
string = string.replace("\uE01D", "```") string = string.replace("\uE01D", "```")