feat: 添加了对markdown的简单封装

This commit is contained in:
2024-03-19 21:56:31 +08:00
parent 15c751b1c8
commit edf390ff43
7 changed files with 74 additions and 81 deletions

View File

@ -29,3 +29,16 @@ def convert_size(size: int, precision: int = 2, add_unit: bool = True, suffix: s
return f"{size:.{precision}f} Y" + suffix
else:
return f"{size:.{precision}f}"
def de_escape(text: str) -> str:
str_map = {
"[": "[",
"]": "]",
"&": "&",
",": ",",
}
for k, v in str_map.items():
text = text.replace(k, v)
return text