Skip to content

fix(layout): leave headerless documents and auto-spaced Hangul paragraphs to Hancom - #514

Merged
airmang merged 2 commits into
mainfrom
fix/page-estimate-without-a-header
Oct 18, 2026
Merged

airmang merged 2 commits into
mainfrom
fix/page-estimate-without-a-header

Conversation

@airmang

@airmang airmang commented Oct 17, 2026

Copy link
Copy Markdown
Owner

무엇

두 가지 "모르면 멈추거나 쓰지 않기" 고침.

  1. 머리 정보 파트 없는 문서: Contents/header.xml이 없는 HWPX에서 estimate_pages가 IndexError로 멈췄다(_Measure가
    root.headers[0]을 읽음). 이제 지원 밖으로 알리고(a document without a header part (Contents/header.xml)),
    write_line_caches도 아무것도 쓰지 않는다.
  2. 한글·영문/숫자 자동 간격: 문단 모양이 hh:autoSpacing(eAsianEng/eAsianNum)을 켜면 한/글은 한글 음절과 영문 글자·숫자
    사이를 넓힌다. FormFit은 아직 그 폭을 모르므로, 그런 문단(한글 바로 옆에 영문 글자 또는 숫자)에는 줄 배치 정보를 쓰지
    않는다. 쓰면 한/글이 그 줄 나눔을 그대로 믿어 글자가 눌릴 수 있었다.

시험

  • test_a_document_without_a_header_part_is_left_unsupported(고치기 전 IndexError).
  • test_a_paragraph_with_automatic_spacing_beside_hangul_is_left_for_hancom(4가지: 영문 간격 + 빈칸 옆만 → 씀, 영문 간격 + 한글 옆 영문 → 안 씀,
    숫자 간격 + 한글 옆 숫자 → 안 씀, 간격 꺼짐 → 씀; 안 씀 둘은 고치기 전 실패).

🤖 Generated with Claude Code

@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.

Reviewed exact head 394ad26.

Reviewed header absence handling before _Measure construction and the cache writer's unsupported early return. Reviewed the per-measure auto-spacing map, enabled-flag parsing and bidirectional Hangul/ASCII-letter-or-digit adjacency guard, including cell paths through _lines. Tests cover headerless ZIP input, no cache mutation, enabled/disabled spacing and non-adjacent Latin text. All 1,524 local line-cache/page-estimate tests pass. No unresolved code finding. All 13 current CI checks pass; verified workflow head SHA and read its test/lint/type/hygiene log (6,934 passed, 18 skipped, 1 xfailed; coverage 90.04%).

Merge held: after #506 and #512 merged, git merge-tree against current main 73d68a7 reproduces content conflicts in CHANGELOG.md. Resolve preserving both PRs' changes and fixture coverage, then revalidate the updated head and combined tree. No conflicted integration-test pass is claimed. COMMENT because this account owns the PR.

@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.

Re-reviewed exact head 9ce2f46. Range-diff shows the header guard correctly moved into _estimate after #506's refactor, while automatic-spacing paragraph exclusion and other reviewed behavior are preserved. Inspected the header guard before _Measure construction, unsupported/no-write return, and per-measure bidirectional Hangul/Latin-or-digit adjacency lookup. No unresolved finding. All 1,526 local cache/page-estimate tests pass. All 13 exact-head checks pass; workflow SHA verified and logs inspected (6,937 passed, 18 skipped, 1 xfailed; lint/types/hygiene pass).

Merge held: git merge-tree with current main 45b9541 after #508/#513 reproduces a CHANGELOG.md conflict. Preserve both changes and rerun latest-head checks/integration after resolution. This remains the safety prerequisite for #515's incomplete automatic-spacing tab-width path. No conflicted integration-test pass is claimed. COMMENT because this account owns the PR.

airmang and others added 2 commits October 18, 2026 14:51
…e page estimate

estimate_pages failed with an IndexError on an HWPX package without
Contents/header.xml; it now reports the document unsupported, and
write_line_caches writes nothing for it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… the line caches

A paragraph shape turning on hh:autoSpacing makes Hancom widen the gap
between Hangul and Latin letters or digits. FormFit does not know that
width yet, so a paragraph putting a Hangul syllable right next to one of
those gets no line cache.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@airmang
airmang force-pushed the fix/page-estimate-without-a-header branch from 9ce2f46 to c60fbf9 Compare October 18, 2026 06:02

@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.

Re-reviewed exact head c60fbf9. Range-diff confirms the previously reviewed headerless-document guard in _estimate and automatic-spacing cache exclusion are unchanged apart from base/CHANGELOG resolution. Rechecked the guard before _Measure construction, public/private estimate entry points, unsupported no-write return and per-measure Hangul/Latin-or-digit adjacency lookup. No unresolved finding; previous conflict is resolved.

All 1,527 local cache/page-estimate tests pass on this head. All 13 current checks pass; CI workflow head SHA verified and test/lint/type/hygiene logs read (6,942 passed, 18 skipped, 1 xfailed; coverage 90.05%). After #509 merged, scratch integration with main 469aa3c was clean; all 1,682 FormFit/cache/page-estimate/body-patch tests pass. Tested tree 7416496072ead57cf906af3b7c406da7828cb3dd. Ready for expected-head-SHA squash merge. COMMENT because this account owns the PR.

@airmang
airmang merged commit 7de747a into main Oct 18, 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