Skip to content

Commit 6204fdd

Browse files
(fix): Nested markdown
Ref: https://t.me/c/1220993104/1386975 Co-authored-by: anonymousx97 <[email protected]>
1 parent 9fc3f6d commit 6204fdd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

pyrogram/parser/markdown.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def create_blockquote(quote_type: str = "") -> None:
106106
# Handle Expandable Quote
107107
inside_blockquote = False
108108
for index, line in enumerate(text_lines):
109-
if line.startswith(BLOCKQUOTE_EXPANDABLE_DELIM):
109+
if line.startswith(BLOCKQUOTE_EXPANDABLE_DELIM) and not inside_blockquote:
110110
delim_stripped_line = line[3:]
111111
parsed_line = (
112112
html.escape(delim_stripped_line) if strict else delim_stripped_line
@@ -118,7 +118,7 @@ def create_blockquote(quote_type: str = "") -> None:
118118
inside_blockquote = True
119119
continue
120120

121-
elif line.endswith(BLOCKQUOTE_EXPANDABLE_END_DELIM):
121+
elif line.endswith(BLOCKQUOTE_EXPANDABLE_END_DELIM) and inside_blockquote:
122122
delim_stripped_line = line[:-3]
123123
parsed_line = (
124124
html.escape(delim_stripped_line) if strict else delim_stripped_line

0 commit comments

Comments
 (0)