diff options
Diffstat (limited to 'publisher/htmlElementsCollector.go')
-rw-r--r-- | publisher/htmlElementsCollector.go | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/publisher/htmlElementsCollector.go b/publisher/htmlElementsCollector.go index 1bc1a09bc..e1c743eab 100644 --- a/publisher/htmlElementsCollector.go +++ b/publisher/htmlElementsCollector.go @@ -152,18 +152,21 @@ type htmlElementsCollectorWriter struct { } // Write collects HTML elements from p. -func (w *htmlElementsCollectorWriter) Write(p []byte) (n int, err error) { - n = len(p) +func (w *htmlElementsCollectorWriter) Write(p []byte) (int, error) { w.input = p - w.pos = 0 for { w.r = w.next() if w.r == eof { - return + break } w.state = w.state(w) } + + w.pos = 0 + w.input = nil + + return len(p), nil } func (l *htmlElementsCollectorWriter) backup() { |