Skip to content

HWPX 저장 시 빈 문단(char_shapes=[])에 spurious (0,0) char_shape 추가 #1592

Description

@planet6897

요약

HWPX 저장 시 run 이 없던 빈 문단에 직렬화기가 빈 <hp:run charPrIDRef="0"><hp:t></hp:t></hp:run>
를 추가
한다. 재파싱 시 char_shapes 가 [][(0,0)] 으로 생겨 IR_DIFF. 잔여 분석 Class D.

대상

36386761_백제학연구총서 위탁판매 의뢰 목록(2026.6.25.).hwpx para[5](빈 문단, cc=1, text_len=0):

expected(orig)=[]  actual(rt)=[(0,0)]
orig XML: <hp:p ...><hp:linesegarray>...        ← run 없음
rt   XML: <hp:p ...><hp:run charPrIDRef="0"><hp:t></hp:t></hp:run><hp:linesegarray>...  ← run 추가

근본원인 (src/serializer/hwpx/section.rs)

  • RunSplitter::new(298-300) "규칙 3": char_shapes 가 비면 기본 (0,0) 세그먼트 추가.
  • close_run(333-335) "규칙 5": 빈 run 도 <hp:t></hp:t> 로 방출.
  • → char_shapes=[] 인 빈 문단에 charPrIDRef="0" run 이 생기고, 재파싱 시 (0,0) char_shape 발생.

원본은 run 이 없어 char_shapes=[]. 판별자는 char_shapes.is_empty()(run 없음↔있음).
대부분 빈 문단은 char_shapes=[(0,0)](run 존재)라 영향 없음 — 본 케이스만 char_shapes=[].

수정 방향

render_runs 에서 문단이 완전히 비었을 때(text·char_shapes·슬롯·field·orphan 전부 없음)
run 을 방출하지 않는다(빈 문자열 반환). char_shapes 가 있으면 종전대로 run 방출(규칙 3/5 유지).

수용 기준

  1. 36386761(목록) para5 IR diff=0(spurious (0,0) 제거).
  2. baseline + lib 회귀 0.
  3. fidelity 통제 비교 순효과>0, 악화0(빈 문단 광역 영향 확인).

근거: mydocs/tech/hwpx_residual_ir_diff_10.md(Class D).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions