Merged
Conversation
Owner
opficdev
commented
Apr 6, 2026
- closed 검색 로직에 Todo 레퍼런스 숫자를 추가한다 #357
Comment on lines
+185
to
+187
| func searchesTodoOnly(_ query: String) -> Bool { | ||
| query.trimmingCharacters(in: .whitespacesAndNewlines).hasPrefix("#") | ||
| } |
Contributor
There was a problem hiding this comment.
searchesTodoOnly 메서드가 #으로 시작하는 모든 검색어에 대해 true를 반환하고 있습니다. 이로 인해 #swift와 같은 일반적인 해시태그 검색 시에도 웹 페이지 검색 결과가 차단되는 부작용이 발생할 수 있습니다. Todo 레퍼런스 번호 검색(예: #123)인 경우에만 웹 페이지 검색을 건너뛰도록 숫자인지 확인하는 로직을 추가하는 것이 좋습니다.
func searchesTodoOnly(_ query: String) -> Bool {
let trimmed = query.trimmingCharacters(in: .whitespacesAndNewlines)
guard trimmed.hasPrefix("#") else {
return false
}
let numberText = trimmed.dropFirst()
return !numberText.isEmpty && numberText.allSatisfy(\.isNumber)
}
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.