From ef292805854345a4bcf5fb02b11c26ea4909c6e4 Mon Sep 17 00:00:00 2001 From: yanyongyu Date: Thu, 1 Oct 2020 00:39:44 +0800 Subject: [PATCH] :bulb: add escape_tag docstring --- nonebot/utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/nonebot/utils.py b/nonebot/utils.py index b442f6bd..aa718819 100644 --- a/nonebot/utils.py +++ b/nonebot/utils.py @@ -11,6 +11,14 @@ from nonebot.typing import Any, Callable, Awaitable, overrides def escape_tag(s: str) -> str: + """ + :说明: + 用于记录带颜色日志时转义 `` 类型特殊标签 + :参数: + * ``s: str``: 需要转义的字符串 + :返回: + - ``str`` + """ return re.sub(r"\s]*)>", r"\\\g<0>", s)