updated dependencies and moved to new rendering

This commit is contained in:
ston1th 2020-11-12 22:54:50 +01:00
commit 0a55030ae5
467 changed files with 64111 additions and 111050 deletions

View file

@ -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
}