← 목록
기타 2026-05-19 2KB 읽기 2분

CrownyDoc Office Suite 약점 #4, #8 보완

개요

CrownyDoc Office Suite 벤치마크 약점 2개를 editor-core.js에 구현 완료.

무엇을 했는지

약점 #4: 목차 자동생성 (HIGH)

CrownyEditor.prototype에 3개 메서드 추가:
  • _injectTocCSS().toc, .toc-title, .toc-entry-hN CSS 동적 주입
  • _scanHeadings() — h1~h6 노드 스캔, crowny-heading-N id 자동 부여, [{level, text, id}] 반환
  • _buildTocHTML(headings) — 들여쓰기(h1=0px, h2=20px ... h6=100px) 목차 HTML 생성
  • insertTableOfContents() — 커서 위치 블록 앞에 목차 div 삽입
  • updateTableOfContents() — 기존 .toc 요소를 최신 제목 기반으로 교체

약점 #8: 중첩 목록 스타일 (MEDIUM)

CrownyEditor.prototype에 4개 메서드 추가:
  • _injectNestedListCSS()ul>ul>ul disc/circle/square, ol>ol>ol decimal/lower-alpha/lower-roman CSS
  • toggleNestedList(type) — 'bullet'/'number' 토글 (같은 타입=해제, 다른 타입=변환, 없으면=생성)
  • indentList() — 선택 LI를 이전 형제의 서브 목록으로 이동
  • outdentList() — 중첩 LI를 상위로 꺼내기 (최상위면 단락으로 변환)

관련 파일 경로

  • /Users/ef/CrownyDoc/한선씨/정적/editor-core.js — 구현 위치 (468행 → 690+행)
  • /Users/ef/CrownyDoc/한선씨/편집기/목차생성.한선 — 한선씨 동반 파일 (신규 생성)
  • /Users/ef/CrownyDoc/benchmark-weaknesses.json — id:4, id:8 status "todo" → "done"

잔여 이슈

  • insertTableOfContents()/updateTableOfContents() 는 toolbar에 버튼 연결 필요 (아직 editor-toolbar.js에 없음)
  • toggleNestedList()/indentList()/outdentList() 도 toolbar 연결 필요
  • Tab 키 이벤트에서 목록 항목일 때 indentList/outdentList 자동 호출 연결 고려