aboutsummaryrefslogtreecommitdiffhomepage
path: root/publisher
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <[email protected]>2021-05-19 03:45:30 +0200
committerBjørn Erik Pedersen <[email protected]>2021-05-19 03:45:30 +0200
commit3f515f0e3395b24776ae24045b846ff2b33b8906 (patch)
treeae56b2ac4b307d421bfbebc3efaa83abb16e0f59 /publisher
parenta9bcd38181ceb79afba82adcd4de1aebf571e74c (diff)
downloadhugo-3f515f0e3395b24776ae24045b846ff2b33b8906.tar.gz
hugo-3f515f0e3395b24776ae24045b846ff2b33b8906.zip
Revert "publisher: Get the collector in line with the io.Writer interface"
This reverts commit a9bcd38181ceb79afba82adcd4de1aebf571e74c.
Diffstat (limited to 'publisher')
-rw-r--r--publisher/htmlElementsCollector.go11
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() {