Skip to content

fix(reverse_sync): roundtrip verifier 정규화를 추가합니다#974

Open
jk-kim0 wants to merge 2 commits intomainfrom
jk/fix-reverse-sync-verify-roundtrip
Open

fix(reverse_sync): roundtrip verifier 정규화를 추가합니다#974
jk-kim0 wants to merge 2 commits intomainfrom
jk/fix-reverse-sync-verify-roundtrip

Conversation

@jk-kim0
Copy link
Copy Markdown
Contributor

@jk-kim0 jk-kim0 commented Apr 2, 2026

Description

bin/reverse-sync verify --branch=split/ko-proofread-20260221-administrator-manual-general 실행 시 발생하는 verify diff의 원인을 조사하고, roundtrip verifier에 누락된 정규화를 추가합니다.

목표

verifier 정규화를 정비하여, MDX 교정이 실질적으로 Confluence XHTML 수정으로 이어지는지 검증 가능하게 합니다.

불일치 현상 및 원인

현재 브랜치에서 정규화를 전부 비활성화하면 45건 중 8건 FAIL (총 diff 23줄)이 발생합니다.

# 패턴 diff 줄 파일 수 원인 적용 정규화
1 테이블 셀 패딩 10 1 FC의 컬럼 폭 계산과 improved.mdx의 수동 패딩이 다름 (maintenance.mdx) _normalize_table_cell_padding (기존)
2 리스트 항목 선행 이중 공백 (* * ) 4 2 FC가 XHTML NavigableString의 선행 공백을 보존하여 * text 출력 (api-token.mdx, custom-attribute.mdx) _normalize_consecutive_spaces_in_text (기존)
3 <br/> 앞 공백 (.<br/>. <br/>) 6 2 FC의 인라인 요소 결합 시 <br/> 앞뒤 공백 처리 차이 (integrating-with-event-callback.mdx, setting-up-multi-factor-authentication.mdx) _normalize_br_space (기존)
4 <li> 번호 (12.) 1 1 FC가 이미지만 포함된 <li>를 번호만 있는 항목으로 출력하지만, improved.mdx에서는 제거됨 (integrating-with-email.mdx) _normalize_empty_list_items (기존, 이 PR에서 정규식 개선)
5 trailing 빈 줄 2 2 FC 블록 사이 빈 줄 수 차이, 또는 empty list item 제거 후 남은 빈 줄 (identity-providers.mdx, user-management.mdx) _normalize_consecutive_blank_lines (이 PR에서 신규 추가), _normalize_blank_line_after_br (이 PR에서 신규 추가)

변경 내용

roundtrip_verifier.py:

  • _normalize_empty_list_items: 빈 줄 치환(^([ \t]+)\d+\.\s*$'') → 줄째 제거(^[ \t]+\d+\.\s*\n'')로 개선 — 기존 정규식은 빈 줄을 남겨서 연속 빈 줄 문제를 유발
  • _normalize_consecutive_blank_lines 추가: 3개 이상 연속 개행 → 2개로 정규화
  • _normalize_blank_line_after_br 추가: <br/> 뒤 빈 줄 제거

test_reverse_sync_roundtrip_verifier.py:

  • _normalize_empty_list_items 단위 테스트 3건
  • _normalize_consecutive_blank_lines 단위 테스트 3건
  • _normalize_blank_line_after_br 단위 테스트 3건
  • verify_roundtrip 통합 테스트 3건 (각 패턴이 정규화로 PASS되는지 검증)

검증

943 pytest passed
42 reverse-sync bug tests passed
45/45 verify passed (split/ko-proofread-20260221-administrator-manual-general)

Added/updated tests?

  • Yes — 단위 테스트 9건 + 통합 테스트 3건 추가

Additional notes

  • 테이블 셀 CJK 패딩 원인인 FC len()_display_width() 수정은 별도 PR #975로 분리하여 머지 완료 (174줄 → 10줄로 감소)
  • 테이블 셀 패딩은 _normalize_table_cell_padding으로 공백 차이를 무시하는 것이 올바른 접근

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
querypie-docs Ready Ready Preview, Comment Apr 3, 2026 0:30am

Request Review

@jk-kim0 jk-kim0 self-assigned this Apr 2, 2026
@jk-kim0 jk-kim0 changed the title confluence-mdx: FC 라운드트립 차이 재현 테스트케이스를 추가합니다 confluence-mdx: FC 알려진 버그 재현 Python 단위 테스트를 추가합니다 Apr 2, 2026
@jk-kim0 jk-kim0 changed the title confluence-mdx: FC 알려진 버그 재현 Python 단위 테스트를 추가합니다 fix(converter): FC 버그 5건 수정 및 roundtrip verifier 정규화를 정비합니다 Apr 3, 2026
@jk-kim0 jk-kim0 changed the title fix(converter): FC 버그 5건 수정 및 roundtrip verifier 정규화를 정비합니다 fix(converter): FC 테이블 CJK 폭 수정 및 roundtrip verifier 정규화를 정비합니다 Apr 3, 2026
@jk-kim0 jk-kim0 changed the title fix(converter): FC 테이블 CJK 폭 수정 및 roundtrip verifier 정규화를 정비합니다 fix(reverse_sync): roundtrip verifier 정규화를 정비합니다 Apr 3, 2026
@jk-kim0 jk-kim0 changed the title fix(reverse_sync): roundtrip verifier 정규화를 정비합니다 fix(reverse_sync): roundtrip verifier 정규화를 추가합니다 Apr 3, 2026
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-verify-roundtrip branch from c350d4c to 665a5bd Compare April 3, 2026 09:36
jk-kim0 and others added 2 commits April 3, 2026 21:23
- _normalize_empty_list_items: 빈 줄 치환 → 줄째 제거로 변경
- _normalize_consecutive_blank_lines: 연속 빈 줄(3+) → 단일 빈 줄 정규화 추가
- _normalize_blank_line_after_br: <br/> 뒤 빈 줄 제거 정규화 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- _normalize_empty_list_items: 빈 번호 줄 제거 단위 테스트 3건
- _normalize_consecutive_blank_lines: 연속 빈 줄 정규화 단위 테스트 3건
- _normalize_blank_line_after_br: <br/> 뒤 빈 줄 제거 단위 테스트 3건
- verify_roundtrip 통합 테스트 3건 (각 정규화가 PASS 처리되는지 검증)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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