fix:更新协议隐私问题

This commit is contained in:
吕新雨
2026-02-25 17:42:34 +08:00
parent 7fcc64f6e3
commit 43e33eb991
3 changed files with 61 additions and 18 deletions

View File

@@ -265,7 +265,7 @@ def choose_content_by_lang(text: str, lang: ResolvedLang) -> tuple[str, Resolved
return en, "en"
def render_as_simple_html(title: str, content: str) -> str:
def render_as_simple_html(title: str, content: str, html_lang: str = "en") -> str:
"""
将文本以简单 HTML 的方式展示(使用 pre 保留换行并自动换行)。
不做 Markdown 渲染,避免引入额外依赖,确保“最小可用、必有内容”。
@@ -273,8 +273,9 @@ def render_as_simple_html(title: str, content: str) -> str:
safe_title = html.escape(title)
safe_content = html.escape(content)
safe_lang = html.escape(html_lang or "en")
return f"""<!doctype html>
<html lang="en">
<html lang="{safe_lang}">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />