From: Bjørn Erik Pedersen Date: Wed, 19 May 2021 01:45:30 +0000 (+0200) Subject: Revert "publisher: Get the collector in line with the io.Writer interface" X-Git-Tag: v0.84.0~40 X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=3f515f0e3395b24776ae24045b846ff2b33b8906;p=brevno-suite%2Fhugo Revert "publisher: Get the collector in line with the io.Writer interface" This reverts commit a9bcd38181ceb79afba82adcd4de1aebf571e74c. --- diff --git a/publisher/htmlElementsCollector.go b/publisher/htmlElementsCollector.go index e1c743ea..1bc1a09b 100644 --- a/publisher/htmlElementsCollector.go +++ b/publisher/htmlElementsCollector.go @@ -152,21 +152,18 @@ type htmlElementsCollectorWriter struct { } // Write collects HTML elements from p. -func (w *htmlElementsCollectorWriter) Write(p []byte) (int, error) { +func (w *htmlElementsCollectorWriter) Write(p []byte) (n int, err error) { + n = len(p) w.input = p + w.pos = 0 for { w.r = w.next() if w.r == eof { - break + return } w.state = w.state(w) } - - w.pos = 0 - w.input = nil - - return len(p), nil } func (l *htmlElementsCollectorWriter) backup() {