confluence-mdx: reverse_sync callout 매크로 패치 누락 수정#853
Open
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
8d46ebb to
61ff9c7
Compare
## Description - Callout 매크로(`<ac:structured-macro ac:name="panel">`)의 `xhtml_plain_text`에서 파라미터 메타데이터(`:purple_circle:`, `1f7e3`, `🟣`, `#F4F5F7` 등)를 제외하고 `<ac:rich-text-body>` 내 body 텍스트만 추출하도록 수정합니다. - `<ac:emoticon>` 태그의 `ac:emoji-fallback` 속성값(🔎 등)을 텍스트에 포함하는 `_get_text_with_emoticons()` 헬퍼를 추가합니다. MDX에서 리터럴 이모지로 표현되는 emoticon을 XHTML 측에서도 동일하게 포함시켜 텍스트 매칭을 가능하게 합니다. - `_find_text_match` 4차 pass 추가: 20자 짧은 prefix 포함 매칭으로 emoticon/lost_info 차이가 있어도 매칭이 가능합니다. - `_resolve_child_mapping` 5차 pass 추가: 앞부분 20자 prefix 비교로 child paragraph를 emoticon 차이에도 불구하고 정확히 찾습니다. - `xhtml_patcher`의 modify 검증에서 `get_text()` 대신 `_get_text_with_emoticons()`를 사용하여 emoticon fallback 텍스트를 포함한 비교를 수행합니다. ### Background 페이지 544375505 (menu-improvement-guide-9120.mdx)에서 Callout 블록의 텍스트 변경이 XHTML에 패치되지 않는 문제가 있었습니다. 원인은 3가지였습니다: 1. `mapping_recorder`가 `get_text()`로 전체 매크로 텍스트를 추출하여 파라미터 메타데이터가 `xhtml_plain_text`에 포함됨 → sidecar 텍스트 매칭 실패 2. `<ac:emoticon>` 태그가 self-closing으로 `get_text()`에서 이모지가 누락됨 → MDX 텍스트와 매칭 불일치 3. `xhtml_patcher`의 modify 검증에서 `get_text()` 결과가 `old_plain_text`와 다름 → 패치가 skip됨 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
61ff9c7 to
8902f3d
Compare
- _resolve_child_mapping 5차 prefix 매칭에 길이 비율 검사를 추가합니다. - callout 전체 텍스트가 내부 paragraph와 같은 prefix를 공유하는 경우, old_nospace가 child의 2배를 초과하면 잘못된 매칭으로 판단합니다. - 기존: callout(238자)이 paragraph-30(40자)와 prefix 매칭되어 list-31 내부 변경(지정시 → 지정 시)이 누락되었습니다. - 수정: 길이 비율 > 2배이면 prefix 매칭에서 제외하고 containing strategy로 처리하여 두 변경이 모두 적용됩니다. - 재현 테스트를 추가합니다 (test_prefix_match_rejects_long_text). 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.
Description
reverse_sync에서 callout 매크로(panel,info,note등) 내부 텍스트 변경이 패치되지 않는 버그를 수정합니다.menu-improvement-guide-9120.mdx)에서 발견된 문제입니다.Background
3가지 계층에서 동시에 문제가 발생했습니다:
mapping_recorder.py: callout 매크로의xhtml_plain_text추출 시<ac:parameter>메타데이터(:purple_circle:,#F4F5F7등)가 포함되고,<ac:emoticon>의 fallback 텍스트(🔎)가 누락되어 sidecar 텍스트 매칭이 실패sidecar.py/patch_builder.py: emoticon 차이로 인한 텍스트 불일치를 허용하는 짧은 prefix 매칭 패스가 없어 매핑 실패xhtml_patcher.py: modify 검증에서element.get_text()를 사용하여 emoticon fallback 텍스트가 빠진 채 비교, 패치 적용이 skip됨수정 내용
mapping_recorder.py:_get_text_with_emoticons()헬퍼 추가, callout 매크로는<ac:rich-text-body>에서만 텍스트 추출sidecar.py:_find_text_match에 4차 짧은 prefix 포함 매칭 패스 추가patch_builder.py:_resolve_child_mapping에 5차 prefix 매칭 패스 추가xhtml_patcher.py: modify 검증을_get_text_with_emoticons()사용으로 변경Related tickets & links
bin/reverse_sync_cli.py verify --branch=split/ko-proofread-20260221-release-notes실패 6건 중 마지막 건Added/updated tests?
test_callout_panel_excludes_parameter_metadata: panel callout의xhtml_plain_text에서 파라미터 메타데이터 제외 검증test_callout_includes_emoticon_fallback_text:<ac:emoticon>fallback 텍스트 포함 검증test_short_prefix_match_with_emoticon_difference: emoticon 차이 시 짧은 prefix 매칭 검증test_short_prefix_match_with_metadata_prefix: 메타데이터 prefix 매칭 검증test_callout_panel_with_emoticon_maps_to_mdx: panel+emoticon 통합 sidecar 매핑 검증Additional notes
🔎앞 공백 정규화 차이(double space)만 잔존 (Bug 4와 동일 유형의 XHTML round-trip 정규화)🤖 Generated with Claude Code
Co-Authored-By: Claude Opus 4.6 noreply@anthropic.com