diff --git a/app/modules/project/store.py b/app/modules/project/store.py index 0a6cc62..0fef6b5 100644 --- a/app/modules/project/store.py +++ b/app/modules/project/store.py @@ -347,6 +347,8 @@ _DESC_ALLOWED_ATTRS: dict[str, frozenset[str]] = { "img": frozenset({"src", "alt", "width", "height"}), "span": frozenset({"class", "data-email"}), "input": frozenset({"type", "checked"}), + # ul: 체크리스트(서식 도구 ☑ — 줄마다 체크박스) 표시용 class="pj-checklist" 하나만 + "ul": frozenset({"class"}), } # URL 은 금지 목록이 아니라 허용 목록으로 검사한다. 금지 목록(javascript: 등)은 # "jav ascript:" 처럼 중간에 탭/개행을 끼우면 통과하는데, 브라우저는 URL 을 @@ -368,6 +370,8 @@ def inline_safe_content_type(content_type: Any) -> bool: return norm_str(content_type, lower=True).split(";", 1)[0].strip() in INLINE_SAFE_CONTENT_TYPES # 멘션 칩: @이름 _MENTION_CLASS = "pj-mention" +# 태그별로 남길 수 있는 class 값(하나씩) — 그 밖의 class 는 버린다. +_DESC_ALLOWED_CLASS: dict[str, str] = {"span": _MENTION_CLASS, "ul": "pj-checklist"} # script/style 은 태그 자체는 물론 그 안의 텍스트(코드)도 통째로 버린다 — # 허용 태그 목록에 없어 태그는 이미 안 남지만, HTMLParser는 이 둘의 내용을 # 별도 데이터로 넘기므로 handle_data 에서 따로 걸러야 한다. @@ -438,9 +442,9 @@ class _DescriptionSanitizer(HTMLParser): continue if name == "src" and not desc_url_is_safe(value, allow_data_image=True): continue - # class 는 멘션 칩 하나만 허용한다(임의 클래스로 화면 스타일을 - # 흔들 여지를 남기지 않는다). - if name == "class" and value.strip() != _MENTION_CLASS: + # class 는 태그마다 정해진 값 하나만(멘션 칩·체크리스트) — 임의 클래스로 + # 화면 스타일을 흔들 여지를 남기지 않는다. + if name == "class" and value.strip() != _DESC_ALLOWED_CLASS.get(tag): continue kept.append(f'{name}="{_desc_escape_attr(value)}"') attr_text = (" " + " ".join(kept)) if kept else "" diff --git a/app/modules/project/templates/project/help.html b/app/modules/project/templates/project/help.html index 09f7615..6f05227 100644 --- a/app/modules/project/templates/project/help.html +++ b/app/modules/project/templates/project/help.html @@ -1,8 +1,8 @@ {% extends "erp_base.html" %} {% block head_extra %} - - + + {% endblock %} @@ -275,7 +275,7 @@

설명