chore: update .gitignore and enhance docstrings across multiple files

- Added *.pyc and *.pyo to .gitignore to prevent compiled Python files from being tracked.
- Improved docstrings in various modules, providing clearer descriptions of functions, parameters, and return values to enhance code readability and maintainability.
This commit is contained in:
zhangtao
2026-04-04 01:21:59 +08:00
parent dcf8844453
commit b0ae6af3b1
96 changed files with 5089 additions and 304 deletions
+6 -3
View File
@@ -119,13 +119,16 @@ def sanitize_html(content: str) -> str:
def sanitize_html_with_styles(content: str) -> str:
"""
清理 HTML 内容(包含样式),移除潜在的 XSS 攻击代码
清理 HTML 内容;标签与属性白名单与 `sanitize_html` 一致
参数:
- content (str): 需要清理的 HTML 内容
- content (str): 需要清理的 HTML 内容
返回:
- str: 清理后的安全 HTML 内容
- str: 清理后的 HTML 字符串。
说明:
- `ALLOWED_STYLES` 供后续接入 bleach 样式清洗时使用,当前实现与 `sanitize_html` 相同。
"""
if not content:
return content