Add RenderNode to Renderer interface

This commit is contained in:
Vytautas Šaltenis 2016-07-05 07:32:16 +03:00
parent cb6bd67271
commit 2f1f0b6b9f
2 changed files with 13 additions and 2 deletions

View File

@ -15,7 +15,10 @@
package blackfriday
import "bytes"
import (
"bytes"
"io"
)
// Latex is a type that implements the Renderer interface for LaTeX output.
//
@ -323,5 +326,11 @@ func (r *Latex) DocumentFooter() {
}
func (r *Latex) Render(ast *Node) []byte {
// TODO
return nil
}
func (r *Latex) RenderNode(w io.Writer, node *Node, entering bool) WalkStatus {
// TODO
return GoToNext
}

View File

@ -21,6 +21,7 @@ package blackfriday
import (
"bytes"
"fmt"
"io"
"strings"
"unicode/utf8"
)
@ -168,9 +169,10 @@ var blockTags = map[string]struct{}{
// If the callback returns false, the rendering function should reset the
// output buffer as though it had never been called.
//
// Currently Html and Latex implementations are provided
// Currently HTML and Latex implementations are provided
type Renderer interface {
Render(ast *Node) []byte
RenderNode(w io.Writer, node *Node, entering bool) WalkStatus
}
// Callback functions for inline parsing. One such function is defined