Skip to content

Comments

confluence-mdx: xhtml_patcher에서 <strong> 뒤 조사 앞 공백 제거 처리#821

Merged
jk-kim0 merged 1 commit intomainfrom
jk/debug-reverse-sync
Feb 20, 2026
Merged

confluence-mdx: xhtml_patcher에서 <strong> 뒤 조사 앞 공백 제거 처리#821
jk-kim0 merged 1 commit intomainfrom
jk/debug-reverse-sync

Conversation

@jk-kim0
Copy link
Contributor

@jk-kim0 jk-kim0 commented Feb 19, 2026

Summary

  • _apply_text_changes()에서 <strong>IDENTIFIER</strong> 를 패턴의 공백 제거 버그를 수정합니다.
  • 직전 텍스트 노드 범위와 현재 텍스트 노드 범위 사이의 gap이 diff로 삭제된 경우, leading whitespace를 제거하도록 수정합니다.
  • 회귀 방지를 위한 단위 테스트를 추가합니다.

배경

Confluence XHTML에서 <h3>Q: 운영 도중 <strong>AGENT_SECRET</strong> 를 변경해도...</h3> 형태의 구조를 패치할 때, <strong> 다음 텍스트 노드()의 leading whitespace가 diff에서 삭제 대상이더라도 기존 코드는 이 공백을 항상 보존했습니다.

원인 분석

_apply_text_changes()의 텍스트 노드 처리에서:

  • old_stripped에서 텍스트 노드 간 gap(AGENT_SECRET 사이 공백)은 별도 인덱스 위치에 존재
  • 해당 gap은 어느 텍스트 노드의 node_start~node_end 범위에도 포함되지 않아 opcode가 처리되지 않음
  • 결과적으로 diff가 공백을 삭제해도 leading whitespace는 그대로 복원됨

수정 내용

현재 노드 처리 시 직전 노드 범위와 현재 노드 범위 사이의 gap을 _map_text_range()로 검사합니다. gap이 diff로 완전히 삭제된 경우(gap_new == ''), leading whitespace를 제거합니다.

Test plan

  • test_remove_space_before_korean_particle_after_strong 신규 테스트 통과
  • 기존 19개 테스트 전체 통과 (pytest tests/test_reverse_sync_xhtml_patcher.py)

🤖 Generated with Claude Code

@vercel
Copy link

vercel bot commented Feb 19, 2026

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

Project Deployment Actions Updated (UTC)
querypie-docs Canceled Canceled Comment Feb 20, 2026 6:44am

Request Review

@jk-kim0 jk-kim0 self-assigned this Feb 20, 2026
<strong>IDENTIFIER</strong> 뒤 텍스트 노드의 leading whitespace가 diff에서
삭제된 경우, xhtml_patcher가 해당 공백을 제거하지 못하는 버그를 수정합니다.

직전 텍스트 노드 범위와 현재 텍스트 노드 범위 사이의 gap이 diff로 삭제된
경우(gap_new == ''), leading whitespace를 제거하도록 수정합니다.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@jk-kim0 jk-kim0 force-pushed the jk/debug-reverse-sync branch from 83ca18c to 2cc22b1 Compare February 20, 2026 06:41
@jk-kim0 jk-kim0 enabled auto-merge (squash) February 20, 2026 06:41
@jk-kim0 jk-kim0 merged commit 60c5390 into main Feb 20, 2026
5 of 7 checks passed
@jk-kim0 jk-kim0 deleted the jk/debug-reverse-sync branch February 20, 2026 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants