Skip to content

Commit cbd34d5

Browse files
committed
Add option to set MaxBuf in html.Parse
1 parent 9617c63 commit cbd34d5

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

html/parse.go

+7
Original file line numberDiff line numberDiff line change
@@ -2366,6 +2366,13 @@ func ParseOptionEnableScripting(enable bool) ParseOption {
23662366
}
23672367
}
23682368

2369+
// ParseOptionSetTokenizerMaxBuf sets the maximum buffer size for the tokenizer.
2370+
func ParseOptionSetTokenizerMaxBuf(maxBuf int) ParseOption {
2371+
return func(p *parser) {
2372+
p.tokenizer.SetMaxBuf(maxBuf)
2373+
}
2374+
}
2375+
23692376
// ParseWithOptions is like Parse, with options.
23702377
func ParseWithOptions(r io.Reader, opts ...ParseOption) (*Node, error) {
23712378
p := &parser{

0 commit comments

Comments
 (0)