From c66d470166182084f2f977efd879919e729f022c Mon Sep 17 00:00:00 2001 From: snowy Date: Mon, 27 May 2024 18:32:58 +0800 Subject: [PATCH] =?UTF-8?q?:bug:=20mdts=E5=8F=8D=E8=BD=AC=E4=B9=89?= =?UTF-8?q?=E9=94=99=E8=AF=AF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- liteyuki/plugins/liteyuki_markdowntest.py | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/liteyuki/plugins/liteyuki_markdowntest.py b/liteyuki/plugins/liteyuki_markdowntest.py index 4890ec6f..1acb5ee5 100644 --- a/liteyuki/plugins/liteyuki_markdowntest.py +++ b/liteyuki/plugins/liteyuki_markdowntest.py @@ -12,19 +12,11 @@ md_test = on_command("mdts", permission=SUPERUSER) btn_test = on_command("btnts", permission=SUPERUSER) latex_test = on_command("latex", permission=SUPERUSER) -placeholder = { - "[": "[", - "]": "]", - "&": "&", - ",": ",", - "\n" : r"\n", -} - @md_test.handle() async def _(bot: T_Bot, event: T_MessageEvent, arg: v11.Message = CommandArg()): await md.send_md( - str(arg), + v11.utils.unescape(str(arg)), bot, message_type=event.message_type, session_id=event.user_id if event.message_type == "private" else event.group_id @@ -43,7 +35,7 @@ async def _(bot: T_Bot, event: T_MessageEvent, arg: v11.Message = CommandArg()): @latex_test.handle() async def _(bot: T_Bot, event: T_MessageEvent, arg: v11.Message = CommandArg()): - latex_text = f"$${str(arg)}$$" + latex_text = f"$${v11.utils.unescape(str(arg))}$$" img = await md_to_pic(latex_text) await bot.send(event=event, message=MessageSegment.image(img))