diff --git a/html.go b/html.go index e43495d..06685e4 100644 --- a/html.go +++ b/html.go @@ -187,6 +187,10 @@ func (r *Html) CopyWrites(processor func()) []byte { return output.Bytes() } +func (r *Html) Write(b []byte) (int, error) { + return r.w.Write(b) +} + func (r *Html) GetResult() []byte { return r.w.output.Bytes() } diff --git a/inline.go b/inline.go index 0a169a8..7779ce7 100644 --- a/inline.go +++ b/inline.go @@ -748,7 +748,7 @@ func autoLink(p *parser, data []byte, offset int) int { anchorStr := anchorRe.Find(data[anchorStart:]) if anchorStr != nil { - out.Write(anchorStr[offsetFromAnchor:]) // XXX: write in parser? + p.r.Write(anchorStr[offsetFromAnchor:]) // XXX: write in parser? return len(anchorStr) - offsetFromAnchor } diff --git a/latex.go b/latex.go index 5f43654..65a352e 100644 --- a/latex.go +++ b/latex.go @@ -60,6 +60,10 @@ func (r *Latex) CopyWrites(processor func()) []byte { return output.Bytes() } +func (r *Latex) Write(b []byte) (int, error) { + return r.w.Write(b) +} + func (r *Latex) GetResult() []byte { return r.w.output.Bytes() } diff --git a/markdown.go b/markdown.go index 39a8347..28782a9 100644 --- a/markdown.go +++ b/markdown.go @@ -204,6 +204,7 @@ type Renderer interface { GetFlags() HtmlFlags CaptureWrites(processor func()) []byte CopyWrites(processor func()) []byte + Write(b []byte) (int, error) GetResult() []byte }