From 3f515f0e3395b24776ae24045b846ff2b33b8906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 19 May 2021 03:45:30 +0200 Subject: [PATCH] Revert "publisher: Get the collector in line with the io.Writer interface" This reverts commit a9bcd38181ceb79afba82adcd4de1aebf571e74c. --- publisher/htmlElementsCollector.go | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/publisher/htmlElementsCollector.go b/publisher/htmlElementsCollector.go index e1c743eab..1bc1a09bc 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() {