feat: HWP 3.0 파서 구현 — parse_hwp3() → Document IR (#417)#451
Closed
jangster77 wants to merge 7 commits into
Closed
Conversation
- src/parser/hwp3/ 신규: 9개 파일 (mod, records, paragraph, encoding, johab, johab_map, special_char, drawing, ole) · parse_hwp3() → Document IR 변환 파이프라인 구현 · Johab 조합형 → UTF-8 디코딩 · 표/그림/그리기 객체/머리말꼬리말/각주미주 기본 파싱 · debug println! 4건 제거 + clippy 오류 3건 수정 - src/parser/mod.rs: FileFormat::Hwp3 → parse_hwp3() 라우팅 - src/bin/dump_pictures.rs: 그림 덤프 유틸 신규 - samples/hwp3-sample.hwp: 테스트용 HWP3 샘플 파일 (87KB) - mydocs/: 수행/구현계획서, Stage1 완료보고서, 오늘할일 신규 hwp3-sample.hwp export-svg: 20페이지 SVG 생성 성공 cargo test --lib: 1016 passed / cargo clippy: clean Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- picture_footnote.rs: Para-relative 그림 반환 y를 base_y 기준으로 수정 (이전: y_offset+total_height → 후속 단락이 그림 위로 겹침) - paragraph_layout.rs: 캡션 AutoNumber 위치에 U+FFFC 처리 추가 (HWP3는 AutoNumber 위치를 U+FFFC로 저장, HWP5 " " 패턴과 별도 처리) - hwp3/mod.rs: caption.width=0 → pic.common.width로 보정 (캡션 렌더링 복원) - hwp3/mod.rs + parser/mod.rs: HWP3 그림 카운터 방식 수정 (HWP3는 Control::Picture 개체 자체가 카운터를 올림 — 캡션 유무 무관) 꼬리말 로고(tac=true)가 카운터 1을 선점하여 본문 그림은 2부터 시작 → 그림 번호 한컴과 일치: 그림2/3/4/5 (이전: 그림1/2/3/4) - pagination/engine.rs: Para-relative vert_offset 처리 주석 추가 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
추가정보블록 #1 TagID 3 (하이퍼텍스트 정보) 파싱 추가 — 스펙 §8.3. 각 항목 617바이트: data[0..256]=파일명(URL, kchar, null종료). 추가정보블록 순서가 본문 하이퍼링크 등장 순서와 일치하므로 순서 매핑으로 Control::Hyperlink.url에 설정. (hwp3-sample.hwp에는 하이퍼링크 없어 직접 검증 불가) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
edwardkim
added a commit
that referenced
this pull request
May 8, 2026
작업지시자 지적 영역 정정: "이 컨트리뷰터도 여러번 PR 하신 분입니다." 직접 점검 결과 (gh pr list --author jangster77 --state all): - @jangster77 (Taesup Jang) 영역의 PR 영역 누적 13건 - HWP 3.0 파서 영역의 핵심 영역 컨트리뷰터 (PR #451 부터 누적) - 이전 영역의 review/report/orders 영역의 "첫 사이클" 영역 표현 영역 정정 정정 영역: - mydocs/pr/archives/pr_673_review.md (3 곳) - mydocs/pr/archives/pr_673_report.md (2 곳) - mydocs/orders/20260508.md (2 곳) 메모리 룰 신규 등록: - feedback_contributor_cycle_check — PR review 시작 시 gh pr list --author 영역 영역으로 누적 점검 의무 영역. "첫 사이클" 영역 임의 추정 금지 영역. - 핵심 컨트리뷰터 영역 명단 영역 영구 보존
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
개요
HWP 3.0(
.hwp) 파일을 HWP5/HWPX와 동일한 Document IR로 변환하는parse_hwp3()파이프라인을 구현합니다. 기존 WASM API를 통해 렌더링이 가능합니다.src/parser/hwp3/신규 추가 (9개 파일): records, paragraph, encoding,Johab 코덱, 특수문자, 그림, OLE 이미지 추출
src/parser/mod.rs: HWP 3.0 매직 바이트 감지 및 라우팅y_offset+h→base_y+h로 수정caption.width = 0→pic.common.width로 보정Control::Picture개체마다 카운터 증가(
is_hwp3플래그로 HWP5/HWPX와 분기)테스트
cargo test --lib: 1016 passed / 0 failedcargo clippy -- -D warnings: cleanrhwp export-svg samples/hwp3-sample.hwp: 20페이지 SVG 정상 생성알려진 한계
HWP3 혼합 단락(텍스트 + Para-relative 그림) 내 vpos 기반 줄 배치 미구현으로
텍스트/그림 겹침 발생 — #425에서 별도 추적.
Closes #417