Skip to content

refactor(reverse_sync): 리스트 마커 공백 감지를 별도 함수로 분리합니다#984

Open
jk-kim0 wants to merge 1 commit intomainfrom
jk/fix-reverse-sync-inline-boundary-whitespace
Open

refactor(reverse_sync): 리스트 마커 공백 감지를 별도 함수로 분리합니다#984
jk-kim0 wants to merge 1 commit intomainfrom
jk/fix-reverse-sync-inline-boundary-whitespace

Conversation

@jk-kim0
Copy link
Copy Markdown
Contributor

@jk-kim0 jk-kim0 commented Apr 5, 2026

Summary

  • _normalize_list_for_content_compare에서 마커 뒤 공백(current_marker_ws)을 텍스트 접두어로 포함하던 방식을 제거합니다
  • 마커 공백 변경은 _has_marker_ws_change 함수로 별도 감지하도록 분리합니다
  • collapse_ws 호출을 replace('\n', ' ').strip()으로 교체하여, 내부 가시 공백을 보존하면서 XHTML과 정렬합니다
  • preserved anchor 리스트에서 마커 공백만 변경된 경우 불필요한 diff 연산(_apply_mdx_diff_to_xhtml)을 건너뛰도록 개선합니다

변경 파일

파일 변경
patch_builder.py _normalize_list_for_content_compare: current_marker_ws 제거, 항목별 .strip() 추가
patch_builder.py _has_marker_ws_change: 마커 뒤 공백 변경 별도 감지 함수 신규
patch_builder.py collapse_ws(_old_plain_raw)_old_plain_raw.replace('\n', ' ').strip()
patch_builder.py has_any_changehas_marker_ws_change 플래그 포함

Test plan

  • _normalize_list_for_content_compare 마커 공백 무시 단위 테스트 6건 통과
  • _has_marker_ws_change 단위 테스트 5건 추가 및 통과
  • pytest 단위 테스트 129건 전체 통과

🤖 Generated with Claude Code

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 5, 2026

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

Project Deployment Actions Updated (UTC)
querypie-docs Ready Ready Preview, Comment Apr 10, 2026 9:10am

Request Review

@jk-kim0 jk-kim0 self-assigned this Apr 6, 2026
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-inline-boundary-whitespace branch from 8ff1ab0 to 21b9b91 Compare April 6, 2026 15:22
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-inline-boundary-whitespace branch from 21b9b91 to 53b154a Compare April 7, 2026 02:59
@jk-kim0 jk-kim0 changed the title fix(reverse_sync): XHTML 인라인 요소 경계의 연속 공백을 정규화합니다 refactor(reverse_sync): 리스트 마커 공백 감지를 별도 함수로 분리하고 collapse_ws를 제거합니다 Apr 7, 2026
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-inline-boundary-whitespace branch from 53b154a to 4e83359 Compare April 7, 2026 03:05
…리합니다

_normalize_list_for_content_compare에서 marker_ws prefix를 출력에 포함하던 방식을
제거하고, _has_marker_ws_change로 별도 감지하도록 변경합니다.

이로써 collapse_ws 호출 없이 replace('\n', ' ').strip()만으로 XHTML 정렬이
가능해지며, preserved anchor 리스트에서 marker-ws-only 변경이 no-op 패치를
생성하는 문제가 해소됩니다.

- _normalize_list_for_content_compare: current_marker_ws 제거, 항목별 strip 추가
- _has_marker_ws_change: 마커 뒤 공백 변경 별도 감지 함수 추가
- collapse_ws(_old_plain_raw) → _old_plain_raw.replace('\n', ' ').strip()
- has_any_change에 has_marker_ws_change 포함
- 테스트: 기존 marker ws 단위 테스트 갱신 + _has_marker_ws_change 테스트 5건 추가

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@jk-kim0 jk-kim0 force-pushed the jk/fix-reverse-sync-inline-boundary-whitespace branch from 4e83359 to 9387539 Compare April 10, 2026 09:06
@jk-kim0 jk-kim0 changed the title refactor(reverse_sync): 리스트 마커 공백 감지를 별도 함수로 분리하고 collapse_ws를 제거합니다 refactor(reverse_sync): 리스트 마커 공백 감지를 별도 함수로 분리합니다 Apr 10, 2026
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