Skip to content

test(layout): pin how a table set as a character goes to the next page - #425

Merged
airmang merged 1 commit into
mainfrom
test/page-estimate-table-as-character-moves
Oct 7, 2026
Merged

airmang merged 1 commit into
mainfrom
test/page-estimate-table-as-character-moves

Conversation

@airmang

@airmang airmang commented Oct 6, 2026

Copy link
Copy Markdown
Owner

바뀐 점

쪽 수 추정(실험, estimate_pages)이 글자처럼 둔 표를 쪽 끝에서 한/글처럼 다음 쪽으로 옮기는지를 한/글 저장본으로 고정한다. 코드는 바꾸지 않는다.

한/글의 동작

  • 글자처럼 둔 표는 쪽에서 나뉘지 않는다. 표 나눔 설정(pageBreak CELL·TABLE·NONE)과 상관없다.
  • 표 줄의 아래끝(줄 위치 + 표 높이)이 본문 끝보다 위면 그 쪽에 남는다. 같거나 아래면 표 전체가 다음 쪽 맨 위로 간다.
  • 줄 간격은 따지지 않는다. 간격까지 더하면 본문 끝을 넘는 표도 아래끝이 본문 안이면 남는다.
  • 쪽보다 큰 표는 다음 쪽 맨 위에 놓여 아래가 잘린 채 그려지고, 뒤 글은 그다음 쪽으로 간다.

테스트

tests/test_layout_page_estimate.py의 HANCOM_PAGES에 한/글 저장본 여섯을 더한다. 캐시가 있을 때와 없을 때 모든 줄 위치와 쪽 수를 시험한다.

  • 아래끝이 본문 끝보다 1 위인 표(남음)와, 본문 끝인 표(옮겨짐)
  • 표 나눔이 TABLE인 표(옮겨짐)
  • 고정 줄 간격에서 남는 표와 옮겨지는 표. 이때는 다음 줄이 표와 겹친다.
  • 쪽보다 큰 표(다음 쪽 맨 위, 뒤 글은 그다음 쪽)

여섯 모두 지금 코드에서 맞는다.

🤖 Generated with Claude Code

Hancom never splits a table set as a character: one whose line does not
end above the body's foot goes on whole to the next page's top, whatever
the spacing after it or its page-break setting, and one taller than a
page stands at the next page's top, cut. Six Hancom-saved cases pin the
page estimate to that.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang merged commit 4834f72 into main Oct 7, 2026
13 checks passed
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