Fix word overflow in file search page (#32695)

This commit is contained in:
yp05327
2024-12-04 01:52:25 +09:00
repo.diff.committed_by GitHub
repo.diff.parent 136408307c
repo.diff.commit 690d07470c
repo.diff.stats_desc%!(EXTRA int=2, int=2, int=1)

repo.diff.view_file

@@ -90,6 +90,7 @@ function filterRepoFiles(filter) {
const span = document.createElement('span');
// safely escape by using textContent
span.textContent = part;
span.title = span.textContent;
// if the target file path is "abc/xyz", to search "bx", then the matchResult is ['a', 'b', 'c/', 'x', 'yz']
// the matchResult[odd] is matched and highlighted to red.
if (index % 2 === 1) span.classList.add('ui', 'text', 'red');