fix(feedback): 하이라이트 영문 단어 중간 오강조 방지#132
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
회의적 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>
bc11b5b to
0cdd7f4
Compare
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.
변경 사항
#131(피드백 하이라이트) 회의적 max 리뷰에서 잡힌 LOW 결함(3/3 검증) 수정.
문제:
HighlightedText가 키워드를 단어 경계 없이gisubstring 매칭 → 영문 단어 내부를 잘못<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