File tree Expand file tree Collapse file tree 1 file changed +4
-0
lines changed
Expand file tree Collapse file tree 1 file changed +4
-0
lines changed Original file line number Diff line number Diff line change @@ -673,6 +673,8 @@ def text_html(self):
673673
674674 if entity .type == MessageEntity .TEXT_LINK :
675675 insert = '<a href="{}">{}</a>' .format (entity .url , text )
676+ elif entity .type == MessageEntity .URL :
677+ insert = '<a href="{0}">{0}</a>' .format (text )
676678 elif entity .type == MessageEntity .BOLD :
677679 insert = '<b>' + text + '</b>'
678680 elif entity .type == MessageEntity .ITALIC :
@@ -723,6 +725,8 @@ def text_markdown(self):
723725
724726 if entity .type == MessageEntity .TEXT_LINK :
725727 insert = '[{}]({})' .format (text , entity .url )
728+ elif entity .type == MessageEntity .URL :
729+ insert = '[{0}]({0})' .format (text )
726730 elif entity .type == MessageEntity .BOLD :
727731 insert = '*' + text + '*'
728732 elif entity .type == MessageEntity .ITALIC :
You can’t perform that action at this time.
0 commit comments