Skip to content

feat(layout): write the line of a paragraph holding a table, and the table's height - #494

Open
airmang wants to merge 1 commit into
feat/layout-line-caches-table-cellsfrom
feat/layout-line-caches-table-lines
Open

airmang wants to merge 1 commit into
feat/layout-line-caches-table-cellsfrom
feat/layout-line-caches-table-lines

Conversation

@airmang

@airmang airmang commented Oct 16, 2026 •

Copy link
Copy Markdown
Owner

Stacked on #493.

Summary

  • write_line_caches now also writes the single line of a body paragraph that holds only a table set as a character, the way Hancom Office writes it:
    • the line is as tall as the table's rows plus the table's outer margins;
    • the baseline sits at 85 % of that height;
    • the line is spaced the way the paragraph's characters are.
  • The table's own height (hp:sz) is set to the height of its rows, which is the value Hancom saves. python-hwpx used to write the sum of the rows' least heights here.
  • A row is as tall as its cells' lines, so the line is written only when every paragraph of the table's cells is one the function lays out surely; otherwise the paragraph is left for Hancom.
  • New tests check that a paragraph holding a new table gets one line as tall as the table, and that a table with an emoji in a cell keeps its line for Hancom. The Hancom-saved form fixture also checks this paragraph's line against Hancom's.

Test plan

  • The new test fails before the change and passes after it
  • Lint, format, type checks and the other repository gates
  • Full test suite: no new failures

🤖 Generated with Claude Code

@airmang
airmang force-pushed the feat/layout-line-caches-table-lines branch 2 times, most recently from 271b323 to 927ff61 Compare October 16, 2026 18:43
…table's height

write_line_caches now also writes the one line of a body paragraph that
holds nothing but a table set as a character, as Hancom Office writes
it: as tall as the table's rows and its outer margins, the baseline at
85 % of that, spaced as the paragraph's characters are. The table's own
height (hp:sz), which python-hwpx writes as its rows' least heights, is
set to its rows' height as Hancom saves it. Since a row is as tall as
its cells' lines, the line is written only when every paragraph of the
table's cells is one the function lays out surely.

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

@airmang airmang left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

d8dfbe946604ddfb8aacba46d1a276df156c7b6a에서 광고된 선행 브랜치 대비 diff와 글자처럼 놓인 표만 든 문단의 줄 높이와 hp:sz 기록 및 셀 측정 확실성 검사를 검토했습니다. 별도 체크아웃의 줄 캐시 회귀 테스트 17개가 통과했고, 정확한 head의 모든 CI 검사 및 Python 3.12 로그(6864 passed, 18 skipped, 1 xfailed; coverage 기준, Ruff·mypy·Pyright·공개 게이트 통과)를 확인했습니다. 이 PR 고유 변경에서 추가로 재현한 결함은 없습니다. 다만 이 브랜치는 미병합 #491에 연쇄 의존하며, 그 PR의 캐시 작성 후 문단 위치 변경 결함이 여전히 재현되고 리뷰 스레드도 미해결입니다. 선행 문제가 수정·병합된 뒤 최신 base/head와 통합 결과를 재검증할 때까지 보류합니다.

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