修复通知文件换行符解析错误

This commit is contained in:
whyour
2024-09-09 23:19:58 +08:00
parent ff98c3a499
commit 926ad067c1
2 changed files with 27 additions and 23 deletions
+3 -1
View File
@@ -852,7 +852,9 @@ def custom_notify(title: str, content: str) -> None:
body = parse_body(
WEBHOOK_BODY,
WEBHOOK_CONTENT_TYPE,
lambda v: v.replace("$title", title).replace("$content", content),
lambda v: v.replace("$title", title.replace("\n", "\\n")).replace(
"$content", content.replace("\n", "\\n")
),
)
formatted_url = WEBHOOK_URL.replace(
"$title", urllib.parse.quote_plus(title)