Skip to content

fix(feedback): 하이라이트 영문 단어 중간 오강조 방지#132

Merged
i3months merged 1 commit into
devfrom
feature/highlight-word-boundary
Jun 29, 2026
Merged

fix(feedback): 하이라이트 영문 단어 중간 오강조 방지#132
i3months merged 1 commit into
devfrom
feature/highlight-word-boundary

Conversation

@i3months

Copy link
Copy Markdown
Member

변경 사항

#131(피드백 하이라이트) 회의적 max 리뷰에서 잡힌 LOW 결함(3/3 검증) 수정.

문제: HighlightedText가 키워드를 단어 경계 없이 gi substring 매칭 → 영문 단어 내부를 잘못 <mark>. 예) 'AI' → "detail"·"main", 'Go' → "Google". 한글 본문에 섞인 영문 기술 단어에서 빈번. (크래시·보안 아님, UX 정확성)

수정: 순수 ASCII term 은 ASCII 경계 lookaround (?<![A-Za-z0-9])…(?![A-Za-z0-9]) 로 감싸 단어 중간 매칭 차단. 한글/혼용 구절은 경계 개념이 모호하고 긴 구절이라 그대로 둠 → "둘 다(키워드+AI구절) 강조"는 유지. lookaround 는 zero-width 라 split 의 캡처그룹 1개 가정 불변.

검증: ["AI","Go","Trade-off","두괄식 답변"] 로 테스트 시 독립 단어만 매칭되고 detail/main/Google 오강조 사라짐. npm run build 통과, lint clean.

🤖 Generated with Claude Code

@vercel

vercel Bot commented Jun 29, 2026

Copy link
Copy Markdown

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

Project Deployment Actions Updated (UTC)
stackup Ready Ready Preview, Comment Jun 29, 2026 4:54am

회의적 max 리뷰(3/3)에서 발견. 키워드를 단어 경계 없이 substring 매칭해
영문 단어 내부를 잘못 강조('AI'→"detail"/"main", 'Go'→"Google").

- HighlightedText: 순수 ASCII term 은 ASCII 경계 lookaround 로 감싸 단어 중간
  매칭 차단. 한글/혼용 구절은 경계 모호 + 긴 구절이라 그대로 유지(둘 다 강조 유지).
- lookaround 는 zero-width 라 split 캡처그룹 1개 가정 불변.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@i3months i3months force-pushed the feature/highlight-word-boundary branch from bc11b5b to 0cdd7f4 Compare June 29, 2026 04:54
@i3months i3months merged commit 2e81d37 into dev Jun 29, 2026
2 checks passed
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