插件管理添加翻页按钮,支持从内存快速获取当前session状态

This commit is contained in:
2024-04-17 20:45:44 +08:00
parent 0e02af59ca
commit 0e47e3c163
7 changed files with 147 additions and 63 deletions

View File

@ -18,11 +18,10 @@ def escape_md(text: str) -> str:
Returns:
str: 转义后文本
"""
text = text.replace("\n", r"\n").replace('"', r'\\\"')
spacial_chars = r"\`*_{}[]()#+-.!"
for char in spacial_chars:
text = text.replace(char, "\\" + char)
return text
text = text.replace(char, "\\\\" + char)
return text.replace("\n", r"\n").replace('"', r'\\\"')
def escape_decorator(func):
@ -41,7 +40,6 @@ def compile_md(comps: list[str]) -> str:
Returns:
str: 编译后文本
"""
print("".join(comps))
return "".join(comps)
@ -80,7 +78,7 @@ class MarkdownComponent:
@staticmethod
def quote(text: str) -> str:
"""引用"""
return f"> {text}\n"
return f"> {text}\n\n"
@staticmethod
def link(text: str, url: str, symbol: bool = True) -> str: