diff options
author | Bjørn Erik Pedersen <[email protected]> | 2021-05-19 03:45:30 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2021-05-19 03:45:30 +0200 |
commit | 3f515f0e3395b24776ae24045b846ff2b33b8906 (patch) | |
tree | ae56b2ac4b307d421bfbebc3efaa83abb16e0f59 | |
parent | a9bcd38181ceb79afba82adcd4de1aebf571e74c (diff) | |
download | hugo-3f515f0e3395b24776ae24045b846ff2b33b8906.tar.gz hugo-3f515f0e3395b24776ae24045b846ff2b33b8906.zip |
Revert "publisher: Get the collector in line with the io.Writer interface"
This reverts commit a9bcd38181ceb79afba82adcd4de1aebf571e74c.
-rw-r--r-- | publisher/htmlElementsCollector.go | 11 |
1 files 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() { |