Skip to content

confluence-mdx: ADF panel 재구성 시 stale fallback 제거 및 container reconstructor 방어 코드 추가#910

Open
jk-kim0 wants to merge 6 commits intomainfrom
jk/fix-reverse-sync-mdx-to-xhtml-inline-escape
Open

confluence-mdx: ADF panel 재구성 시 stale fallback 제거 및 container reconstructor 방어 코드 추가#910
jk-kim0 wants to merge 6 commits intomainfrom
jk/fix-reverse-sync-mdx-to-xhtml-inline-escape

Conversation

@jk-kim0
Copy link
Copy Markdown
Contributor

@jk-kim0 jk-kim0 commented Mar 11, 2026

문제

ADF panel (ac:adf-extension) container를 anchor 재구성한 뒤, ac:adf-fallback
원본 텍스트가 stale 상태로 남아 Confluence 렌더링 시 불일치가 발생할 수 있었습니다.

수정 내용

ADF fallback 처리 (pipeline-reachable 버그 수정)

  • _apply_outer_wrapper_template()에 ADF fallback 처리를 추가합니다.
    • 재구성된 children에 Confluence 전용 markup(<ac:, <ri:)이 포함되면
      fallback을 제거합니다 (fallback div에 ac: 요소를 넣을 수 없으므로).
    • 일반 텍스트만 포함되면 fallback body도 함께 업데이트합니다.
  • _find_adf_fallback_body(), _fragments_contain_confluence_markup() 헬퍼를 추가합니다.

Container reconstructor 방어 코드 (direct-call safety)

현재 pipeline에서 clean container는 container_sidecar_requires_reconstruction()
게이트가 False를 반환하여 reconstruct_container_fragment()에 도달하지 않습니다.
아래 변경은 향후 리팩터링 시 안전장치로 기능합니다:

  • template 빌드를 clean container 분기 이전으로 이동하여,
    직접 호출 시에도 sidecar wrapper를 보존합니다.
  • container child의 items 재구성 경로를 추가합니다.
  • _find_container_body(), _replace_container_body_children() 헬퍼를 분리합니다.

테스트

Pipeline-reachable (main에서 실패, PR에서 성공)

  • test_adf_panel_with_anchor_preserves_adf_wrapper
    — ADF panel e2e: stale fallback 제거 및 wrapper 보존 검증

Direct-call (방어 코드 검증)

  • test_clean_container_preserves_template_wrapper
  • test_clean_adf_container_updates_fallback_body
  • test_anchor_bearing_adf_container_drops_stale_fallback

검증

python3 -m pytest tests/test_reverse_sync_reconstruct_container.py -v
python3 -m pytest -q

@jk-kim0 jk-kim0 changed the title fix(confluence-mdx): reverse-sync heading 변환 시 code span HTML 특수문자를 이스케이프합니다 fix(reverse_sync): heading 변환 시 code span HTML 특수문자를 이스케이프합니다 Mar 11, 2026
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-mdx-to-xhtml-inline-escape branch from 6430287 to af0a6aa Compare March 11, 2026 16:45
@vercel
Copy link
Copy Markdown

vercel bot commented Mar 11, 2026

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

Project Deployment Actions Updated (UTC)
querypie-docs Ready Ready Preview, Comment Mar 28, 2026 10:34am

Request Review

@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-mdx-to-xhtml-inline-escape branch from af0a6aa to 018efe2 Compare March 12, 2026 05:41
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-mdx-to-xhtml-inline-escape branch from 018efe2 to 782fae8 Compare March 12, 2026 06:39
@jk-kim0 jk-kim0 marked this pull request as draft March 12, 2026 06:41
@jk-kim0 jk-kim0 changed the title fix(reverse_sync): heading 변환 시 code span HTML 특수문자를 이스케이프합니다 WIP: 디버깅용 PR Mar 12, 2026
@jk-kim0 jk-kim0 changed the base branch from main to jk/feat-sidecar-type-based-core March 12, 2026 14:43
@jk-kim0 jk-kim0 changed the title WIP: 디버깅용 PR fix(reverse_sync): trailing space→비공백 교체 시 XHTML 반영 누락 수정 Mar 12, 2026
Base automatically changed from jk/feat-sidecar-type-based-core to main March 12, 2026 16:05
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-mdx-to-xhtml-inline-escape branch from 79f1c6a to 3c34267 Compare March 16, 2026 02:53
@jk-kim0 jk-kim0 changed the title fix(reverse_sync): trailing space→비공백 교체 시 XHTML 반영 누락 수정 confluence-mdx: implement Phase 4 container reconstruction Mar 16, 2026
@jk-kim0 jk-kim0 marked this pull request as ready for review March 16, 2026 02:57
@jk-kim0 jk-kim0 changed the title confluence-mdx: implement Phase 4 container reconstruction confluence-mdx: Phase 4 container 재구성을 구현합니다 Mar 16, 2026
@jk-kim0 jk-kim0 self-assigned this Mar 16, 2026
@jk-kim0 jk-kim0 changed the title confluence-mdx: Phase 4 container 재구성을 구현합니다 confluence-mdx: narrow Phase 4 container reconstruction scope Mar 16, 2026
jk-kim0 added a commit that referenced this pull request Mar 16, 2026
… 유지 개선합니다

- _rewrite_paragraph_on_template: paragraph inline tag(bold/em/link/code)를 유지하며
  텍스트만 새 fragment 기준으로 갱신합니다 (PR #910 방식 도입)
- _has_inline_markup: <p>에 ac:image 외 inline 태그 존재 여부를 탐지합니다
- reconstruct_container_fragment: anchor로 reconstruction이 트리거된 경우,
  같은 container 내 inline markup child도 함께 보존합니다
- outer wrapper template: sidecar xhtml_fragment를 기준으로 macro 속성(ac:schema-version 등)
  을 보존합니다 (기존: emitted fragment 기준)

트리거 정책: anchor(ac:image) 또는 list item anchor가 있는 경우에만 reconstruction을
적용하며, inline markup만 있는 container는 text-transfer 유지합니다.
(child 수 불일치 케이스에서 안전성 확보)

Co-Authored-By: Atlas <atlas@jk.agent>
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-mdx-to-xhtml-inline-escape branch from 6d8bcd1 to b23cc42 Compare March 16, 2026 11:25
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-mdx-to-xhtml-inline-escape branch from b23cc42 to ad185c3 Compare March 16, 2026 12:14
@jk-kim0 jk-kim0 changed the title confluence-mdx: narrow Phase 4 container reconstruction scope confluence-mdx: clean container에서 원본 wrapper 타입 유실 수정합니다 Mar 16, 2026
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-mdx-to-xhtml-inline-escape branch 2 times, most recently from 9038f39 to 67fef19 Compare March 16, 2026 15:58
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-mdx-to-xhtml-inline-escape branch from 67fef19 to 9ea0de6 Compare March 27, 2026 04:04
test_adf_panel_with_anchor_preserves_adf_wrapper에 stale fallback 제거를
검증하는 assertion을 추가합니다. 기존 테스트는 main에서도 통과하여
PR의 실질적 동작 차이를 검증하지 못했습니다.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@jk-kim0 jk-kim0 changed the title confluence-mdx: clean container에서 원본 wrapper 타입 유실 수정합니다 confluence-mdx: ADF panel 재구성 시 stale fallback 제거 및 container reconstructor 방어 코드 추가 Mar 28, 2026
template_soup/template_root/template_body가 파싱 후 참조되지 않았습니다.
_apply_outer_wrapper_template()가 자체적으로 template을 파싱하므로 중복이었습니다.
섹션 주석 앞 빈 줄도 복원합니다.

Co-Authored-By: Claude Opus 4.6 (1M context) <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