fix: 행사 이름·장소의 HTML 문자(< 등)를 저장 전에 끝까지 풀기 — 문화정보원 목록이 두 번 인코딩돼 와서 워치·화면에 그대로 보이던 것
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
2621db0450
commit
a74e3b49d0
3 files changed
+28
No files matched your search
@@ -1,3 +1,6 @@
|
||||
import html
|
||||
|
||||
|
||||
def hour_label(h: int) -> str:
|
||||
if h == 0:
|
||||
return "자정"
|
||||
@@ -35,3 +38,10 @@ _COMPASS = ("북", "북북동", "북동", "동북동", "동", "동남동", "남
|
||||
def compass(deg: float) -> str:
|
||||
"""방위각 → 16방위 이름. 263 → "서" """
|
||||
return _COMPASS[round(deg / 22.5) % 16]
|
||||
|
||||
|
||||
def plain(s: str) -> str:
|
||||
"""HTML 문자 참조를 다 푼다. 두 번 인코딩돼 오는 출처도 있어("&lt;") 더 안 바뀔 때까지."""
|
||||
while (u := html.unescape(s)) != s:
|
||||
s = u
|
||||
return s
|
||||
Reference in new issue
Block a user