Add String() method to reference struct

pull/215/head
Vytautas Šaltenis 2015-11-02 20:24:34 +02:00
parent 9e68ff937b
commit c29209fcda
1 changed files with 6 additions and 0 deletions

View File

@ -20,6 +20,7 @@ package blackfriday
import (
"bytes"
"fmt"
"strings"
"unicode/utf8"
)
@ -516,6 +517,11 @@ type reference struct {
text []byte
}
func (r *reference) String() string {
return fmt.Sprintf("{link: %q, title: %q, text: %q, noteId: %d, hasBlock: %v}",
r.link, r.title, r.text, r.noteId, r.hasBlock)
}
// Check whether or not data starts with a reference link.
// If so, it is parsed and stored in the list of references
// (in the render struct).