fix(reverse_sync): 인라인 요소 경계 공백 변경이 XHTML에 반영되지 않는 문제를 수정합니다#985
Merged
fix(reverse_sync): 인라인 요소 경계 공백 변경이 XHTML에 반영되지 않는 문제를 수정합니다#985
Conversation
- build_patches의 has_content_change 비교에서 collapse_ws를 제거하여 이중→단일 공백 등 공백 수 변경을 감지합니다 - _apply_mdx_diff_to_xhtml 전달 시에는 collapse_ws를 유지하여 XHTML plain text와의 정렬을 보장합니다 - normalize_mdx_to_plain의 링크 텍스트에 strip()을 적용하여 [ **T** ] ↔ [**T**] 형식 차이를 흡수합니다 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
…지를 복원합니다 .strip()은 [ **T** ] ↔ [**T**] 경계 공백 변경과 [Okta 연동하기 ] trailing space 변경을 모두 삼켜서 has_content_change가 False로 평가되어 패치가 누락되었습니다. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Contributor
Author
|
[debate-review][sha:ed566c055932a127840cf5b724a7628d7b8e81cb] Review stopped due to an error. Round: 1 Manual review required. |
- isu_001 (confluence-mdx/bin/reverse_sync/patch_builder.py:1064): `normalize_mdx_to_plain()`의 raw 결과를 그대로 비교하면 가시 공백 수정뿐 아니라 리스트 continuation line reflow도 `has_content_change=True`로 분류됩니다. 예를 들어 `* hello world`를 `* hello\n world`로만 바꿔도 이 조건이 참이 되어 `replace_fragment` 패치가 생성되지만, emitter가 만드는 XHTML은 기존과 동일한 `<ul><li><p>hello world</p></li></ul>`입니다. 이번 변경으로 format-only 줄바꿈 정리까지 reverse-sync 패치 대상으로 승격되어 불필요한 no-op 패치가 생깁니다.
- isu_001 (confluence-mdx/bin/reverse_sync/patch_builder.py:1100): 리스트의 공백 변경을 감지한 뒤에도 preserved anchor(<ac:link>/<ri:...>) 경로에서는 _old_plain/_new_plain에 다시 collapse_ws를 적용해서 실제 text transfer 입력이 동일해집니다. 그래서 * 텍스트 [링크](url) 뒤에 -> * 텍스트 [링크](url) 뒤에 같은 공백 확대는 new_plain_text가 그대로 남아 XHTML에 반영되지 않습니다. - isu_002 (confluence-mdx/tests/test_reverse_sync_patch_builder.py:154): 이 테스트를 URL만 바뀌는 케이스로 바꾸면 이번 PR이 고치려는 핵심 회귀인 `[ **General** ] -> [**General**]` 같은 링크 경계 공백 변경을 더 이상 잠그지 못합니다. `normalize_mdx_to_plain()`은 링크 URL을 버리므로, 공백 비교 로직이 다시 깨져도 이 테스트는 계속 통과합니다. 기존 경계 공백 케이스를 별도 회귀 테스트로 남겨야 합니다.
Contributor
Author
|
[debate-review][sha:38c835b0488d6e88e418395417ea77082282d083] Review stopped due to an error. Debate Summary
Round: 6 Manual review required. |
This was referenced Apr 5, 2026
Closed
Closed
1 task
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.
Summary
build_patches의has_content_change판정에서collapse_ws를 분리하고, preserved anchor 리스트 경로에서도 가시 공백 변경이 XHTML에 전파되도록 합니다.목표
reverse-sync patch는 MDX에서 교정한 다음과 같은 공백 변경을 XHTML에 정확히 전파해야 합니다:
모두 "Read-Only"→모두 "Read-Only"[ **General** ]→[**General**][Okta 연동하기 ](url)→[Okta 연동하기](url)텍스트 [링크](url) 뒤에→텍스트 [링크](url) 뒤에Root Cause
has_content_change를collapse_ws(normalize_mdx_to_plain(...))로 비교하면 위 네 가지가 모두False로 평가되어 패치가 생성되지 않습니다.수정
1.
has_content_change비교와_apply_mdx_diff_to_xhtml전달 분리has_content_change비교_normalize_list_for_content_compare_apply_mdx_diff_to_xhtml전달collapse_ws(...)(기본)2. preserved anchor 리스트 경로에서 raw 공백 전이
_contains_preserved_link_markup()으로<ac:link>존재 여부를 판별하여, preserved link가 있는 리스트에서는collapse_ws없이 raw plain text를 text transfer에 전달합니다.<ac:image>등 비링크 매크로는 기존collapse_ws경로를 유지합니다.3. continuation line reflow 무시
_normalize_list_for_content_compare()는 리스트 항목 내부의 continuation line 줄바꿈을 공백으로 합쳐서,* hello world↔* hello\n world같은 format-only 변경이 no-op 패치를 생성하지 않도록 합니다.설계 원칙
has_content_change경로에서collapse_ws,strip등 정규화를 적용하면 교정자가 의도한 공백 변경이 무시됩니다. 변경 감지 비교에는 Markdown 마크업만 제거하고 공백은 원본 그대로 보존해야 합니다.Added/updated tests?
TestWhitespaceOnlyChangeGeneratesPatch— 이중→단일, 단일→이중 공백 변경 패치 생성 검증test_continuation_line_reflow_only_skips_patch— continuation line reflow는 skiptest_path1b_link_boundary_whitespace_generates_patch— 링크 경계 공백 변경 양성 테스트TestPreservedAnchorListWhitespaceTransfer— preserved anchor 리스트 공백 전이 검증test_image_anchor_list_keeps_collapsed_text_diff— ac:image 리스트는 collapse_ws 유지 검증test_normalize_preserves_link_trailing_space— 링크 텍스트 trailing space 보존 검증Verification
🤖 Generated with Claude Code