Skip to content

confluence-mdx: clean container에서 원본 wrapper 타입 유실 수정합니다#910

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

confluence-mdx: clean container에서 원본 wrapper 타입 유실 수정합니다#910
jk-kim0 wants to merge 3 commits intomainfrom
jk/fix-reverse-sync-mdx-to-xhtml-inline-escape

Conversation

@jk-kim0
Copy link
Contributor

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

문제

clean container(anchor 없는 컨테이너)를 재구성할 때 new_fragment를 그대로 반환했습니다.
emit 단계에서 생성된 wrapper 타입(예: ac:structured-macro)이 그대로 남아,
sidecar에 기록된 원본 wrapper 타입(예: ac:adf-extension)이 유실되는 버그가 있었습니다.

수정 내용

  • reconstructors.py
    • template 빌드(sidecar xhtml_fragment 기준)를 clean container 분기 이전으로 이동합니다.
    • clean container도 template wrapper를 사용하되, emitted children을 그대로 삽입합니다.
    • anchor-bearing container는 기존 재구성 로직(anchor 재삽입)을 유지합니다.
    • _find_container_body(), _replace_container_body_children() 헬퍼를 분리해 중복을 제거합니다.

테스트

  • test_clean_container_preserves_template_wrapper 추가
    • emitted fragment가 ac:structured-macro이고 sidecar template이 ac:adf-extension일 때,
      결과가 ac:adf-extension wrapper를 사용하는지 검증합니다.

검증

python3 -m pytest tests/test_reverse_sync_reconstruct_container.py -v
python3 -m pytest -q
make -C tests test-reverse-sync

@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

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 16, 2026 4:01pm

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 from ad185c3 to 9038f39 Compare March 16, 2026 15:39
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-mdx-to-xhtml-inline-escape branch from 9038f39 to 67fef19 Compare March 16, 2026 15:58
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