Skip to content

fix(reverse_sync): 리스트 마커 뒤 공백 변경을 content 비교에서 감지합니다#986

Merged
jk-kim0 merged 1 commit intomainfrom
jk/fix-reverse-sync-li-p-leading-space
Apr 6, 2026
Merged

fix(reverse_sync): 리스트 마커 뒤 공백 변경을 content 비교에서 감지합니다#986
jk-kim0 merged 1 commit intomainfrom
jk/fix-reverse-sync-li-p-leading-space

Conversation

@jk-kim0
Copy link
Copy Markdown
Contributor

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

Summary

  • _normalize_list_for_content_comparenormalize_mdx_to_plain 호출 시 마커와 뒤 공백을 함께 제거하여 * text* text를 동일하게 판정하던 문제를 수정합니다
  • 마커 뒤 공백 수를 정규화 결과에 접두어로 기록하여 공백 차이가 has_content_change로 감지됩니다
  • clean list는 replace_fragmentemit_block 경로를 타며, XHTML <li><p> 내 선행 공백이 자동 교정됩니다

Test plan

  • _normalize_list_for_content_compare 마커 공백 보존 단위 테스트 6건 통과
  • pytest 전체 964건 통과
  • E2E reverse-sync 59건 (16 + 43) 통과

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 6, 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 6, 2026 5:25pm

Request Review

_normalize_list_for_content_compare가 normalize_mdx_to_plain을 호출하며
마커와 그 뒤 공백을 함께 제거하여 `*  text`와 `* text`를 동일하게 판정했습니다.
이로 인해 has_content_change가 False가 되어 replace_fragment 경로를 타지 않아
XHTML <li><p> 내 선행 공백이 교정되지 않았습니다.

마커 뒤 공백 수를 정규화 결과에 접두어로 기록하여 공백 차이가 content 변경으로
감지되도록 수정합니다. 이를 통해 clean list는 replace_fragment → emit_block
경로를 타며, emit_block이 생성하는 clean XHTML에는 선행 공백이 포함되지 않습니다.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-li-p-leading-space branch from e24885a to 669ec3b Compare April 6, 2026 17:22
@jk-kim0 jk-kim0 changed the title fix(reverse_sync): 리스트 마커 뒤 공백 변경을 XHTML에 반영합니다 fix(reverse_sync): 리스트 마커 뒤 공백 변경을 content 비교에서 감지합니다 Apr 6, 2026
@jk-kim0 jk-kim0 self-assigned this Apr 6, 2026
@jk-kim0
Copy link
Copy Markdown
Contributor Author

jk-kim0 commented Apr 6, 2026

[debate-review][sha:669ec3bda26e3b279944fa2d90e4b26c563a2f86] Consensus reached after 5 rounds.

Debate Summary

  • isu_001 [withdrawn] 여기서 마커 뒤 공백을 정규화 문자열에 붙여 has_content_change는 True가 되지만, preserved anchor 리스트는 이후 _apply_mdx_diff_to_xhtml 호출 전에 collapse_ws된 값으로 다시 비교합니다. 그 결과 ac:image 같은 링크가 아닌 preserved anchor가 있는 리스트에서는 4. 항목 -> 4. 항목 변경이 여전히 no-op 패치로 끝나며 XHTML이 갱신되지 않습니다.
  • isu_002 [withdrawn] 이번 추가 테스트들은 _normalize_list_for_content_compare()의 반환값만 확인하고 있어서, 실제 회귀가 발생했던 build_patches()의 has_content_change → replace_fragment 경로는 검증하지 못합니다. end-to-end 테스트를 하나 추가해 두는 편이 안전합니다.

Withdrawn Findings

  • confluence-mdx/bin/reverse_sync/patch_builder.py:207 - 여기서 마커 뒤 공백을 정규화 문자열에 붙여 has_content_change는 True가 되지만, preserved anchor 리스트는 이후 _apply_mdx_diff_to_xhtml 호출 전에 collapse_ws된 값으로 다시 비교합니다. 그 결과 ac:image 같은 링크가 아닌 preserved anchor가 있는 리스트에서는 4. 항목 -> 4. 항목 변경이 여전히 no-op 패치로 끝나며 XHTML이 갱신되지 않습니다.
    Reason: 지적된 현상은 이번 PR이 새로 도입한 결함이 아니라 기존 preserved-anchor 경로의 한계이며, PR 설명과 변경 범위도 clean list 경로 보정에 한정되어 있어 이 finding은 유지하지 않겠습니다.
  • confluence-mdx/tests/test_reverse_sync_patch_builder.py:2977 - 이번 추가 테스트들은 _normalize_list_for_content_compare()의 반환값만 확인하고 있어서, 실제 회귀가 발생했던 build_patches()의 has_content_change → replace_fragment 경로는 검증하지 못합니다. end-to-end 테스트를 하나 추가해 두는 편이 안전합니다.
    Reason: 이번 지적은 보강 제안 수준이었는데, PR에는 이미 reverse-sync E2E 통과 근거가 있고 추가된 단위 테스트도 핵심 변경 로직을 직접 검증하므로, 이 PR에 꼭 필요한 누락 테스트라고 보기는 어렵습니다.

@jk-kim0 jk-kim0 merged commit 83f4442 into main Apr 6, 2026
7 checks passed
@jk-kim0 jk-kim0 deleted the jk/fix-reverse-sync-li-p-leading-space branch April 6, 2026 19:02
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