Fix various documentation, user-facing, and source comment typos (#16367)

* Fix various doc, user-facing, and source comment typos

Found via `codespell -q 3 -S ./options/locale,./vendor -L ba,pullrequest,pullrequests,readby`
This commit is contained in:
luzpaz 2021-07-08 07:38:13 -04:00 committed by GitHub
parent bc6f060b8c
commit e0296b6a6d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
87 changed files with 132 additions and 132 deletions

View file

@ -284,7 +284,7 @@ func (b *ElasticSearchIndexer) Delete(repoID int64) error {
}
// indexPos find words positions for start and the following end on content. It will
// return the beginning position of the frist start and the ending position of the
// return the beginning position of the first start and the ending position of the
// first end following the start string.
// If not found any of the positions, it will return -1, -1.
func indexPos(content, start, end string) (int, int) {
@ -308,8 +308,8 @@ func convertResult(searchResult *elastic.SearchResult, kw string, pageSize int)
var startIndex, endIndex int = -1, -1
c, ok := hit.Highlight["content"]
if ok && len(c) > 0 {
// FIXME: Since the high lighting content will include <em> and </em> for the keywords,
// now we should find the poisitions. But how to avoid html content which contains the
// FIXME: Since the highlighting content will include <em> and </em> for the keywords,
// now we should find the positions. But how to avoid html content which contains the
// <em> and </em> tags? If elastic search has handled that?
startIndex, endIndex = indexPos(c[0], "<em>", "</em>")
if startIndex == -1 {