Skip to content

fix(layout): start a table in a paragraph of spaces on the next page as when alone - #390

Merged
airmang merged 1 commit into
mainfrom
fix/page-estimate-table-and-spaces-starting-on-the-next-page
Oct 2, 2026
Merged

airmang merged 1 commit into
mainfrom
fix/page-estimate-table-and-spaces-starting-on-the-next-page

Conversation

@airmang

@airmang airmang commented Oct 2, 2026

Copy link
Copy Markdown
Owner

바뀐 점

쪽 수 추정(실험, estimate_pages)이 위아래로 둔 표 뒤에 공백만 있는 한 줄 문단을 놓을 때, 표가 그 문단 자리에서 시작하지 못하면 한/글처럼 놓게 한다.

  • #373에서 공백을 글로 보게 된 뒤로, 그런 문단은 글 속에 둔 표처럼 다루어졌다.
    • 나뉘는 표는 지원 밖(a top-and-bottom table anchored in text that starts on the next page)이었다.
    • 나누지 않게 둔 표(pageBreak="NONE")는 문단 줄까지 표와 함께 다음 쪽으로 보냈다.
  • 한/글은 이때 공백이 없을 때와 똑같이 놓는다.
    • 문단 줄은 제자리에 남는다.
    • 표는 다음 쪽 맨 위에서 시작한다.
    • 뒤 글은 그 줄 아래에 이어진다.
    • 표가 그 자리에서 시작하면 전처럼 공백 줄을 표 아래에 둔다.
  • 코드
    • 개체 말고는 공백(U+0020)만 있는 한 줄 문단을 _Para.spaced로 표시한다.
    • _Paginator._anchored는 그 문단의 표가 다음 쪽에서 시작하면 표 혼자인 문단처럼 흘린다(_flow).
  • 변경 로그의 fix(layout): lay a space after a top-and-bottom object out below it #373 항목에 한 줄을 더한다.

테스트

  • tests/test_layout_page_estimate.py의 HANCOM_PAGES에 한/글 저장본 셋을 더한다. 캐시가 있을 때와 없을 때를 모두 시험한다.
    • 문단은 60762 아래에 있고, 10pt 글에 줄 간격 160%다.
    • 표는 세 행이고, 행 높이는 8000, 1282, 1282다.
    • 저장본은 표 뒤에 아무것도 없는 문단(대조), 공백 하나, 나누지 않게 둔 표 뒤 공백 하나다.
  • 고치기 전 코드에서는 공백이 든 두 저장본이 캐시가 있든 없든 실패한다.

🤖 Generated with Claude Code

…as when alone

Hancom lays a table placed top and bottom in a paragraph holding nothing
else but spaces on one line out as when the paragraph holds the table
alone, when the table does not start at the paragraph's place: the table
starts at the next page's top, the paragraph's line stays, and the text
after goes on under that line. So for a table set not to split too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang merged commit cb54754 into main Oct 2, 2026
13 checks passed
@airmang
airmang deleted the fix/page-estimate-table-and-spaces-starting-on-the-next-page branch October 2, 2026 18:24
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