updated dependencies and moved to new rendering
This commit is contained in:
parent
320dc096dd
commit
0a55030ae5
467 changed files with 64111 additions and 111050 deletions
10
vendor/github.com/blevesearch/bleve/search/highlight/format/html/html.go
generated
vendored
10
vendor/github.com/blevesearch/bleve/search/highlight/format/html/html.go
generated
vendored
|
|
@ -15,6 +15,8 @@
|
|||
package html
|
||||
|
||||
import (
|
||||
"html"
|
||||
|
||||
"github.com/blevesearch/bleve/registry"
|
||||
"github.com/blevesearch/bleve/search/highlight"
|
||||
)
|
||||
|
|
@ -54,18 +56,18 @@ func (a *FragmentFormatter) Format(f *highlight.Fragment, orderedTermLocations h
|
|||
break
|
||||
}
|
||||
// add the stuff before this location
|
||||
rv += string(f.Orig[curr:termLocation.Start])
|
||||
// add the color
|
||||
rv += html.EscapeString(string(f.Orig[curr:termLocation.Start]))
|
||||
// start the <mark> tag
|
||||
rv += a.before
|
||||
// add the term itself
|
||||
rv += string(f.Orig[termLocation.Start:termLocation.End])
|
||||
// reset the color
|
||||
// end the <mark> tag
|
||||
rv += a.after
|
||||
// update current
|
||||
curr = termLocation.End
|
||||
}
|
||||
// add any remaining text after the last token
|
||||
rv += string(f.Orig[curr:f.End])
|
||||
rv += html.EscapeString(string(f.Orig[curr:f.End]))
|
||||
|
||||
return rv
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue