diff --git a/app/modules/project/store.py b/app/modules/project/store.py index db14744..0a6cc62 100644 --- a/app/modules/project/store.py +++ b/app/modules/project/store.py @@ -333,8 +333,12 @@ def build_subject_project_done(*, project_name: str) -> str: _DESC_ALLOWED_TAGS: frozenset[str] = frozenset({ "p", "br", "b", "strong", "i", "em", "u", "a", "img", "ul", "ol", "li", "blockquote", "code", "pre", "span", "div", + # 취소선(서식 도구 "S" — 브라우저에 따라 strike/s/del 로 만든다) + "s", "strike", "del", + # 체크박스(서식 도구 "☑") — type="checkbox" 만, 속성은 checked 뿐(아래 _emit_start) + "input", }) -_DESC_VOID_TAGS: frozenset[str] = frozenset({"br", "img"}) +_DESC_VOID_TAGS: frozenset[str] = frozenset({"br", "img", "input"}) # a: target/rel 은 "새 탭에서 열기"용. 화면(설명란)에서 링크를 클릭하면 # 새 탭으로 여는데, 저장했다 다시 열었을 때도 같은 동작이어야 해서 허용한다. # span: 멘션 칩(@이름) 전용 — class="pj-mention" + data-email 만 남긴다. @@ -342,6 +346,7 @@ _DESC_ALLOWED_ATTRS: dict[str, frozenset[str]] = { "a": frozenset({"href", "target", "rel"}), "img": frozenset({"src", "alt", "width", "height"}), "span": frozenset({"class", "data-email"}), + "input": frozenset({"type", "checked"}), } # URL 은 금지 목록이 아니라 허용 목록으로 검사한다. 금지 목록(javascript: 등)은 # "jav ascript:" 처럼 중간에 탭/개행을 끼우면 통과하는데, 브라우저는 URL 을 @@ -411,6 +416,14 @@ class _DescriptionSanitizer(HTMLParser): return if tag not in _DESC_ALLOWED_TAGS: return + # input 은 체크박스만 — 다른 종류(text·file·hidden 등)는 태그째 버리고, + # 체크 여부 말고는 아무 속성도 남기지 않는다. + if tag == "input": + if (dict(attrs).get("type") or "").strip().lower() != "checkbox": + return + checked = any(name == "checked" for name, _ in attrs) + self.out.append('' if checked else '') + return allowed = _DESC_ALLOWED_ATTRS.get(tag, frozenset()) # span 은 멘션 칩일 때만 속성을 갖는다 — class 가 pj-mention 이 아니면 # data-email 까지 통째로 버린다(평범한 span 으로만 남는다). diff --git a/app/modules/project/templates/project/help.html b/app/modules/project/templates/project/help.html index 4735edf..191bb90 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 %} @@ -274,7 +274,8 @@

설명