mirror of
				https://github.com/nonebot/nonebot2.git
				synced 2025-10-31 06:56:39 +00:00 
			
		
		
		
	💡 add escape_tag docstring
This commit is contained in:
		| @@ -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) | ||||
|  | ||||
|  | ||||
|   | ||||
		Reference in New Issue
	
	Block a user