Skip to content

fix(reverse_sync): containing 전략에 inline_fixups 지원을 추가합니다#968

Merged
jk-kim0 merged 4 commits intomainfrom
jk/fix-reverse-sync-containing-inline-fixups
Apr 1, 2026
Merged

fix(reverse_sync): containing 전략에 inline_fixups 지원을 추가합니다#968
jk-kim0 merged 4 commits intomainfrom
jk/fix-reverse-sync-containing-inline-fixups

Conversation

@jk-kim0
Copy link
Copy Markdown
Contributor

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

Summary

  • callout 등 containing 전략 블록에서 bold 경계 변경(**text:****text**:)이 XHTML에 반영되지 않는 문제를 수정합니다
  • _is_content_line에 JSX 컴포넌트 태그(<Callout> 등) 필터를 추가하여 inline fixup 생성 시 wrapper 태그 오염을 방지합니다
  • 동일 plain text를 가진 형제 문단의 match_index 중복 처리를 위해 _offset_inline_fixup_match_indexes 함수를 추가합니다
  • _apply_inline_fixups<p> 외에 heading 태그(<h1>~<h6>)도 순회하도록 확장합니다
  • 영향: integrating-with-secret-store.mdx, integrating-with-ldap.mdx 등 callout 내부 bold-colon 변경이 있는 모든 페이지

원인 분석

containing 전략(callout child → parent 매핑)은 normalize_mdx_to_plain()으로 plain text를 비교하여 텍스트 변경을 감지합니다. Bold 마커가 제거되므로 **text:****text**:가 동일한 text:로 정규화되어 변경이 감지되지 않았습니다.

list 전략에는 이미 _build_inline_fixups를 통한 bold 경계 변경 감지가 있었으나, containing 전략에는 이 메커니즘이 누락되어 있었습니다.

Test plan

  • 단위 테스트: test_containing_bold_colon_inline_fixup 외 4건 추가 및 통과
  • 기존 테스트: pytest test_reverse_sync_patch_builder.py 통과
  • 통합 테스트: make test-reverse-sync 통과
  • 실제 페이지 verify: integrating-with-secret-store PASS, integrating-with-ldap bold-colon PASS

🤖 Generated with Claude Code

callout 등 containing 전략 블록에서 bold 경계 변경(**text:** → **text**:)이
XHTML에 반영되지 않는 문제를 수정합니다.

- containing 전략에 _build_inline_fixups 호출 및 patch entry 누적 추가
- _is_content_line에 JSX 컴포넌트 태그(<Callout> 등) 필터 추가
- 단위 테스트 추가 (test_containing_bold_colon_inline_fixup)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 1, 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 1, 2026 1:50pm

Request Review

- isu_002 (confluence-mdx/bin/reverse_sync/patch_builder.py:943): containing 경로에서 _build_inline_fixups()를 각 child change마다 따로 호출해 그대로 누적하면 동일한 new_plain을 가진 형제 문단들이 모두 match_index: 0으로 저장됩니다. 이후 patch_xhtml()가 new_plain + match_index로 <p>를 찾기 때문에, 같은 callout 안에서 **Name:** -> **Name**: 같은 변경이 두 번 나오면 첫 번째 문단만 수정되고 두 번째 문단은 그대로 남습니다.
- isu_003 (confluence-mdx/bin/reverse_sync/patch_builder.py:977): offset 계산이 이미 수정된 fixup 수만 보고 match_index를 밀기 때문에, 같은 callout 안에 동일한 plain text 문단이 여러 개 있고 그중 뒤쪽 문단만 경계가 바뀌는 경우를 여전히 잘못 처리합니다. 재현: <p><strong>Name:</strong></p><p><strong>Name:</strong></p>에서 두 번째 문단만 변경 시 match_index가 0으로 남아 첫 번째 <p>가 수정됨.
- isu_002 (confluence-mdx/bin/reverse_sync/patch_builder.py:943): containing 경로에서 모든 자식 블록에 대해 inline_fixups를 누적하지만, 실제 적용기인 xhtml_patcher._apply_inline_fixups()는 <p> 태그만 순회합니다. callout 내부 heading처럼 문단이 아닌 자식에서 bold 경계 변경이 들어오면 패치는 생성되어도 XHTML은 그대로 남습니다.
@jk-kim0
Copy link
Copy Markdown
Contributor Author

jk-kim0 commented Apr 1, 2026

[debate-review][sha:bdb5a2001f7018e8cab4c77489d703809eeafb75] Consensus reached after 9 rounds.

Debate Summary

  • isu_001 [withdrawn] _is_content_line wrapper 필터 관련 expand 블록 이슈
  • isu_002 [accepted] build_patches containing inline_fixups match_index 중복 수정
  • isu_003 [accepted] _offset_inline_fixup_match_indexes 위치 offset 수정
  • isu_002 [accepted] _apply_inline_fixups heading 지원 추가

Applied Fixes

  • confluence-mdx/bin/reverse_sync/patch_builder.py:943 - (reported by codex, applied by codex) containing 경로에서 모든 자식 블록에 대해 inline_fixups를 누적하지만, 실제 적용기인 xhtml_patcher._apply_inline_fixups()는

    태그만 순회합니다. callout 내부 heading처럼 문단이 아닌 자식에서 bold 경계 변경이 들어오면 패치는 생성되어도 XHTML은 그대로 남습니다.

  • confluence-mdx/bin/reverse_sync/patch_builder.py:977 - (reported by codex, applied by codex) offset 계산이 이미 수정된 fixup 수만 보고 match_index를 밀기 때문에, 같은 callout 안에 동일한 plain text 문단이 여러 개 있고 그중 뒤쪽 문단만 경계가 바뀌는 경우를 여전히 잘못 처리합니다. 재현:

    Name:

    Name:

    에서 두 번째 문단만 변경 시 match_index가 0으로 남아 첫 번째

    가 수정됨.

Withdrawn Findings

  • confluence-mdx/bin/reverse_sync/patch_builder.py:166 - wrapper 필터가 과 table 계열만 제외해서 같은 containing 타입인
    (expand) 블록에서는 와 outer tag가 그대로 inline_fixup 입력에 섞입니다. 이 상태에서 Body:Body: 변경을 재현하면 new_inner_xhtml가
    Details...
    전체로 만들어져 어떤

    에도 매칭되지 않으므로, expand 본문의 bold 경계 이동은 여전히 XHTML에 반영되지 않습니다.
    Reason: 반박이 타당합니다. mapping_recorder.py에서 expand는 CALLOUT_MACRO_NAMES에 포함되지 않아 자식 매핑이 생성되지 않고, _resolve_mapping_for_change()는 details 변경을 containing이 아니라 direct로 분류합니다. 따라서 containing용 inline_fixups 경로에서는 재현되지 않아 철회합니다.

@jk-kim0 jk-kim0 merged commit 001277a into main Apr 1, 2026
7 checks passed
@jk-kim0 jk-kim0 deleted the jk/fix-reverse-sync-containing-inline-fixups branch April 1, 2026 15:53
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