Skip to content

Commit 7d44438

Browse files
Fix spoiler html unparsing (pyrogram#862)
- The current spoiler implementaion unparses both strikethrough and spoiler tags with <s>, making them indistinguishable
1 parent 23b0208 commit 7d44438

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyrogram/parser/html.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -155,10 +155,10 @@ def unparse(text: str, entities: list):
155155
start = entity.offset
156156
end = start + entity.length
157157

158-
if entity_type in ("bold", "italic", "underline", "strikethrough", "spoiler"):
158+
if entity_type in ("bold", "italic", "underline", "strikethrough"):
159159
start_tag = f"<{entity_type[0]}>"
160160
end_tag = f"</{entity_type[0]}>"
161-
elif entity_type in ("code", "pre", "blockquote"):
161+
elif entity_type in ("code", "pre", "blockquote", "spoiler"):
162162
start_tag = f"<{entity_type}>"
163163
end_tag = f"</{entity_type}>"
164164
elif entity_type == "text_link":

0 commit comments

Comments
 (0)