-
-
Notifications
You must be signed in to change notification settings - Fork 581
fix(hwpx): hp:tc name(셀 필드 이름) 파싱 누락 — HWPX 로드 시 셀 필드 유실 (#493 부분)#1401
fix(hwpx): hp:tc name(셀 필드 이름) 파싱 누락 — HWPX 로드 시 셀 필드 유실 (#493 부분) #1401oksure wants to merge 3 commits into
Conversation
직렬화기는 cell.field_name을 name 속성으로 방출하지만 파서
parse_table_cell이 읽지 않아 HWPX 로드/라운드트립에서 셀 필드
이름이 유실됐다 (HWP5 parse_cell_field_name과 비대칭).
무명 셀의 name=""는 None 유지 (Some("") 오염 방지, HWP5와 동일 의미).
회귀 테스트: basic-table-01.hwpx 셀 필드 이름 부여 → serialize →
reparse 보존 + 무명 셀 None 단언 (수정 전 red 확인).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Note
Copilot was unable to run its full agentic suite in this review.
Fixes Issue #493 by ensuring the HWPX parser reads the hp:tc name attribute (cell field name) and adds a regression test to confirm the value survives an HWPX serialize→parse roundtrip while keeping unnamed cells as None.
Changes:
- Add a new regression test covering named + unnamed table cells across an HWPX roundtrip.
- Update the HWPX table-cell parser to populate
cell.field_namefrom thenameattribute, treating empty strings as "unset".
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| tests/issue_493_hwpx_cell_field_name.rs | Adds a roundtrip regression test for cell.field_name preservation and empty-name handling. |
| src/parser/hwpx/section.rs | Parses hp:tc’s name attribute into cell.field_name (empty string treated as absent). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2a21fa3 에서 반영했습니다 — 인덱싱 전 셀 수(len>=2) 단언을 추가해 실패 시 진단 메시지가 남도록 했습니다.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2a21fa3 에서 반영했습니다 — 빈 name 분기에서 field_name = None을 명시적으로 대입해 초기값 의존을 제거했습니다.
- 라운드트립 후 names 인덱싱 전 len>=2 단언 (실패 진단성) - 파서: name="" 분기에서 field_name을 명시적으로 None 대입 — 초기값 의존 제거 (셀 재사용 등 향후 변경에도 안전) Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
문제
#493에서 보고된 "파일 로드 시 셀 필드이름 누락" 중 HWPX 경로의 결함입니다.
cell.field_name을hp:tc의name속성으로 방출하지만 (serializer/hwpx/table.rswrite_cell)parse_table_cell(parser/hwpx/section.rs)이name속성을 읽지 않아, HWPX 로드 시getFieldList가 셀 필드를 반환하지 못하고 HWPX 라운드트립에서 셀 필드 이름이 유실됩니다.parse_cell_field_name으로 보존하므로 포맷 간 비대칭이었습니다.수정
parse_table_cell에name속성 파싱 추가 (1분기). 직렬화기가 무명 셀에도name=""를 항상 방출하므로 빈 값은None유지 — HWP5 파서와 동일 의미 (Some("")오염 방지).검증
tests/issue_493_hwpx_cell_field_name.rs:basic-table-01.hwpx셀에 필드 이름 부여 → serialize → reparse 보존 + 무명 셀None유지 단언 — 수정 전 red / 수정 후 green 확인cargo fmt -- --check/cargo clippy --all-targets -- -D warnings/cargo test전체 통과범위 비고 (#493 잔여)
Cell모델에 필드가 없어 직렬화기가protect="0"고정 방출 — 모델 추가 + HWP5/HWPX 양쪽 매핑이 필요한 별도 작업이라 본 PR 범위에서 제외했습니다.getFieldList/setFieldValueByName으로 가능해 보입니다.Related #493 (부분 해결 — close하지 않습니다)