confluence-mdx: emitter가 width 있는 ac:image에 ac:custom-width 속성을 추가합니다#947
Merged
confluence-mdx: emitter가 width 있는 ac:image에 ac:custom-width 속성을 추가합니다#947
Conversation
…을 추가합니다 FC(converter/core.py)는 ac:custom-width="true"가 있어야 ac:width를 MDX width=로 변환합니다. 이 속성이 없으면 roundtrip 시 width가 손실됩니다. _figure_attrs_to_ac_image, _emit_figure 두 경로 모두 수정합니다. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Co-Authored-By: Atlas <atlas@jk.agent>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
1 task
jk-kim0
added a commit
that referenced
this pull request
Mar 26, 2026
…ecar reconstruction으로 전환합니다 (#946) ## Description Phase 5 Axis 1: `containing` 전략과 `paired delete+add` 경로에서 **anchor 재구성이 필요한 경우**를 `_build_replace_fragment_patch()` + sidecar reconstruction으로 전환합니다. 그 외 경로는 Confluence 전용 inline markup 보존을 위해 `transfer_text_changes`를 유지합니다. ### Scope 이 PR은 **containing 전략**과 **paired delete+add** 경로만 변경합니다. direct 전략, list 전략, table 전략, xhtml_patcher의 패치 적용 로직은 변경하지 않습니다. ### 주요 변경사항 **patch_builder.py — containing 전략 경로 분기** - **anchor 필요 시** (`sidecar_block_requires_reconstruction`): `_build_replace_fragment_patch` 사용 (emit + reconstruct) - **clean container / sidecar miss / child-of-parent**: `transfer_text_changes` 사용 (원본 XHTML inline markup 보존) - preserved anchor list: `transfer_text_changes` 유지 (Phase 5 Axis 1 미완, 별도 PR 예정) **patch_builder.py — paired delete+add 경로** - anchor reconstruction 필요 → `_build_replace_fragment_patch` - sidecar 없는 preserved anchor markup → `rewrite_on_stored_template` - parameter-bearing container sidecar (`<ac:parameter>` 있음) → `_build_replace_fragment_patch` (per-child 재구성으로 parameter 보존 + body 변경 + inline styling 보존) - clean container sidecar / sidecar 없음 + anchor 없음 → `transfer_text_changes` **reconstructors.py — `reconstruct_container_fragment` clean container 경로** - paragraph merge (emitted < stored): stored body를 template으로 텍스트 재배분 - children 수 불일치: outer wrapper만 적용 - children 수 일치: per-child 재구성 loop으로 fall-through (inline styling 보존) **patch_builder.py — `_accumulate_text_change` 헬퍼** - `_text_change_patches` 누적 패턴을 함수로 추출 (containing + preserved anchor list 공용) ### 이 PR에서 제외된 변경 (별도 PR) - ~~emitter `ac:custom-width="true"` 속성 추가~~ → **PR #947**에서 별도 처리 ### 수정된 버그 - `568918170`: clean callout의 `<em><span style="color:...">Deleted</span></em>` 보존 - `544379140`: paired delete+add에서 `<span style="color:...">` inline styling 보존 - `544178422`: Q&A callout 두 줄 → 단락 병합 문제 (clean container 경로) ### Known limitations (이 PR scope 밖, main에서도 동일) - **modified + direct 전략 + parameter-bearing macro**: `<details>`(expand) 등 `<ac:parameter>`가 있는 macro의 modified 변경이 direct 전략으로 분기될 때, `xhtml_patcher`의 `element.get_text()` vs `old_plain_text` 비교에서 공백 불일치(`TITLEOld text.` vs `TITLE Old text.`)로 body 변경이 silent no-op가 됨. 이것은 `xhtml_patcher`의 기존 한계이며 별도 수정 필요. ## Added/updated tests? - [x] Yes - `test_reverse_sync_reconstruct_container.py`: clean callout text-level 패치, 구조 변경 보호 - `test_reverse_sync_patch_builder.py`: containing 다중 변경 누적, paired delete+add inline styling 보존, parameter 보존+body update, parameter-bearing body inline styling 보존 - `test_reverse_sync_cli.py`: containing 전략 변경 반영 - `expected.reverse-sync.patched.xhtml` fixtures 갱신 - `make test-xhtml-diff`: 15/15, `make test-reverse-sync`: 42/42, `pytest`: 877/877 ## Additional notes - Phase 5 Axis 2 (preserved anchor list `transfer_text_changes` 제거)는 별도 PR 예정 - `transfer_text_changes`는 3개 경로에서 유지됨: 1. containing clean container / sidecar miss (Confluence inline markup 보존) 2. containing child-of-parent (부모 구조 파괴 방지) 3. preserved anchor list (multi-item caption 재배치 버그 회피) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
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
_figure_attrs_to_ac_image,_emit_figure두 경로에서ac:width설정 시ac:custom-width="true"속성을 함께 추가합니다converter/core.py)는ac:custom-width="true"가 있어야ac:width를 MDXwidth=로 변환합니다 — 이 속성이 없으면 roundtrip 시 width가 손실됩니다Test plan
pytest tests/test_mdx_to_storage/test_emitter.py— 54/54 passpytest tests/ --ignore=tests/test_unused_attachments.py— 871/871 passmake test-reverse-sync— 42/42 pass