From d265ac0f21535b5989c4d343d244b9dd06f89925 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Teichgr=C3=A4ber?= Date: Fri, 18 Nov 2011 18:25:39 +0100 Subject: [PATCH] sync with current Go (gofix go1rename, error) --- output.go | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/output.go b/output.go index d40b17a..52d834d 100644 --- a/output.go +++ b/output.go @@ -20,25 +20,24 @@ package markdown // HTML output functions import ( - "os" "fmt" "log" - "rand" + "math/rand" "strings" ) type Writer interface { - WriteString(string) (int, os.Error) - WriteRune(int) (int, os.Error) - WriteByte(byte) os.Error + WriteString(string) (int, error) + WriteRune(int) (int, error) + WriteByte(byte) error } type htmlOut struct { Writer - padded int + padded int - notenum int - endNotes []*element /* List of endnotes to print after main content. */ + notenum int + endNotes []*element /* List of endnotes to print after main content. */ } // WriteHtml prints a document tree in HTML format using the specified Writer. @@ -76,7 +75,6 @@ func (w *htmlOut) s(s string) *htmlOut { return w } - /* print string, escaping for HTML * If obfuscate selected, convert characters to hex or decimal entities at random */ @@ -159,7 +157,7 @@ func (w *htmlOut) elem(elt *element, obfuscate bool) *htmlOut { s = elt.contents.str case LINK: if strings.Index(elt.contents.link.url, "mailto:") == 0 { - obfuscate = true /* obfuscate mailto: links */ + obfuscate = true /* obfuscate mailto: links */ } w.s(` 0 { @@ -183,7 +181,7 @@ func (w *htmlOut) elem(elt *element, obfuscate bool) *htmlOut { /* Shouldn't occur - these are handled by process_raw_blocks() */ log.Fatalf("RAW") case H1, H2, H3, H4, H5, H6: - h := "h" + string('1'+elt.key-H1) + ">" /* assumes H1 ... H6 are in order */ + h := "h" + string('1'+elt.key-H1) + ">" /* assumes H1 ... H6 are in order */ w.pad(2).s("<").s(h).elist(elt.children, obfuscate).s("[%d]`, @@ -231,7 +229,6 @@ func (w *htmlOut) elem(elt *element, obfuscate bool) *htmlOut { return w } - func (w *htmlOut) printEndnotes() { counter := 0