hugolib: Use []byte in shortcode parsing

See #5324
This commit is contained in:
Bjørn Erik Pedersen
2018-10-18 09:47:39 +02:00
parent 27f5a906a2
commit 1b7ecfc2e1
6 changed files with 28 additions and 25 deletions

View File

@@ -60,17 +60,6 @@ type pageLexer struct {
items []Item
}
func Parse(s string) *Tokens {
return ParseFrom(s, 0)
}
func ParseFrom(s string, from int) *Tokens {
input := []byte(s)
lexer := newPageLexer(input, pos(from), lexMainSection) // TODO(bep) 2errors
lexer.run()
return &Tokens{lexer: lexer}
}
// note: the input position here is normally 0 (start), but
// can be set if position of first shortcode is known
// TODO(bep) 2errors byte