From 84f291bc76e0625e53a2203f536687dcf3922f4f Mon Sep 17 00:00:00 2001 From: king Date: Sat, 26 Sep 2026 14:16:29 +0900 Subject: [PATCH] =?UTF-8?q?feat(project):=20=EC=84=A4=EB=AA=85=20=ED=8E=B8?= =?UTF-8?q?=EC=A7=91=20=EC=84=9C=EC=8B=9D=20=EB=8F=84=EA=B5=AC=EC=97=90=20?= =?UTF-8?q?=EC=B7=A8=EC=86=8C=EC=84=A0=C2=B7=EC=B2=B4=ED=81=AC=EB=B0=95?= =?UTF-8?q?=EC=8A=A4=20=EC=B6=94=EA=B0=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 취소선: 서식 도구 S 버튼 + Ctrl+Shift+X (execCommand strikeThrough) - 체크박스: ☑ 버튼으로 커서 자리에 넣고, 누를 때마다 checked 속성을 직접 바꿔 저장·다시 열기에도 체크 상태 유지 - 서버 설명 정리기: s/strike/del 허용, input 은 type="checkbox" 만(checked 외 속성 없음, 다른 종류는 태그째 버림) - 도움말 8장 서식 도구 설명 갱신, 정적 파일 버전 20260926m Co-Authored-By: Claude Opus 5.5 --- app/modules/project/store.py | 15 +++++++++- .../project/templates/project/help.html | 7 +++-- .../project/templates/project/inbox.html | 4 +-- .../project/templates/project/mytasks.html | 4 +-- .../project/templates/project/project.html | 6 ++-- .../project/templates/project/trash.html | 4 +-- app/static/project.css | 5 ++++ app/static/project.js | 30 ++++++++++++++++++- 8 files changed, 62 insertions(+), 13 deletions(-) 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 @@

설명