hugo

Unnamed repository; edit this file 'description' to name the repository.

git clone git://git.shimmy1996.com/hugo.git
commit 3f515f0e3395b24776ae24045b846ff2b33b8906
parent a9bcd38181ceb79afba82adcd4de1aebf571e74c
Author: Bjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>
Date:   Wed, 19 May 2021 03:45:30 +0200

Revert "publisher: Get the collector in line with the io.Writer interface"

This reverts commit a9bcd38181ceb79afba82adcd4de1aebf571e74c.

Diffstat:
Mpublisher/htmlElementsCollector.go | 11++++-------
1 file changed, 4 insertions(+), 7 deletions(-)
diff --git 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() {