Skip to content

fix(styles): refuse a list level past ten - #426

Open
airmang wants to merge 3 commits into
mainfrom
fix/list-level-up-to-ten
Open

airmang wants to merge 3 commits into
mainfrom
fix/list-level-up-to-ten

Conversation

@airmang

@airmang airmang commented Oct 6, 2026

Copy link
Copy Markdown
Owner

바뀐 점

글머리표·번호 목록(doc.styles.apply_list_format)이 10보다 깊은 수준을 받던 것을 고친다. 이제 1 이상 10 이하의 int가 아닌 수준은 무엇도 바꾸기 전에 거부한다.

한/글의 동작

  • 한/글 목록은 1~10수준이다.
  • 목록 문단이 11수준 이상을 쓰는 문서는 한/글이 다시 저장하지 못한다. 배치하다 멈춘다.

고치기 전

  • 수준은 1 미만만 거부했다. 11·255 같은 수준을 그대로 썼다.
  • 실수 수준(1.0)은 내부 TypeError로 끝났다. bool 수준(True)은 1로 받았다.

코드

  • _document/layout.py의 apply_list_format이 수준을 1 이상 10 이하의 int로 검사한다. 오류 코드는 전과 같은 style-list-level-invalid다.
  • errors.py와 docs/error-codes.md에서 그 코드의 설명을 고치고, 변경 로그 항목을 더한다.

테스트

tests/test_list_level_range.py를 더한다.

  • 번호·글머리표 목록에서 수준 0, −1, 11, 255, 1.0, True가 오류 코드와 함께 거부되고, 머리말과 구역 XML이 그대로인지 본다.
  • 수준 1과 10이 문단 모양(hh:heading NUMBER, level 0·9)으로 쓰이는지 본다.
  • 한/글이 11수준 문서를 저장하지 못해 한/글 저장본은 없다. 시험은 python-hwpx로 문서를 지어 확인한다.

고치기 전에는 11, 255, 1.0, True 판이 틀렸다.

🤖 Generated with Claude Code

airmang and others added 3 commits October 6, 2026 14:42
Hancom lists have levels 1 to 10, and Hancom cannot save a document
whose list paragraph uses an eleventh: it stops while laying it out.
apply_list_format refused only levels below 1; a level that is no int
from 1 to 10 is now refused with style-list-level-invalid before
anything changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant