diff --git a/telebot/formatting.py b/telebot/formatting.py index 51869a2a0..24299b51a 100644 --- a/telebot/formatting.py +++ b/telebot/formatting.py @@ -323,7 +323,7 @@ def hide_link(url: str) -> str: return f'' -def mcite(content: str, escape: Optional[bool]=True) -> str: +def mcite(content: str, escape: Optional[bool] = True, expandable: Optional[bool] = False) -> str: """ Returns a Markdown-formatted block-quotation string. @@ -333,11 +333,16 @@ def mcite(content: str, escape: Optional[bool]=True) -> str: :param escape: True if you need to escape special characters. Defaults to True. :type escape: :obj:`bool` + :param expandable: True if you need the quote to be expandable. Defaults to False. + :type expandable: :obj:`bool` + :return: The formatted string. :rtype: :obj:`str` """ content = escape_markdown(content) if escape else content - content = '\n'.join(['>' + line for line in content.split('\n')]) + content = "\n".join([">" + line for line in content.split("\n")]) + if expandable: + return f"**{content}||" return content