💡 add escape_tag docstring

This commit is contained in:
yanyongyu 2020-10-01 00:39:44 +08:00
parent 5b0083c0a8
commit ef29280585

View File

@ -11,6 +11,14 @@ from nonebot.typing import Any, Callable, Awaitable, overrides
def escape_tag(s: str) -> str:
"""
:说明:
用于记录带颜色日志时转义 `<tag>` 类型特殊标签
:参数:
* ``s: str``: 需要转义的字符串
:返回:
- ``str``
"""
return re.sub(r"</?((?:[fb]g\s)?[^<>\s]*)>", r"\\\g<0>", s)