all repos — grayfriday @ d1b544e27876215d6e6dd56bdf7aebb3d2f340a9

blackfriday fork with a few changes

HACK: render TOC the old way, backup and truncate output
Vytautas Ĺ altenis vytas@rtfb.lt
Mon, 09 Nov 2015 21:28:23 +0200
commit

d1b544e27876215d6e6dd56bdf7aebb3d2f340a9

parent

97235182ac5e768200740f8050b75e07bb97a43f

1 files changed, 3 insertions(+), 3 deletions(-)

jump to
M html.gohtml.go

@@ -794,7 +794,7 @@ }

r.w.WriteString("</head>\n") r.w.WriteString("<body>\n") - r.tocMarker = out.Len() + r.tocMarker = r.w.output.Len() // XXX } func (r *Html) DocumentFooter() {

@@ -806,10 +806,10 @@ // now we have to insert the table of contents into the document

var temp bytes.Buffer // start by making a copy of everything after the document header - temp.Write(out.Bytes()[r.tocMarker:]) + temp.Write(r.w.output.Bytes()[r.tocMarker:]) // now clear the copied material from the main output buffer - out.Truncate(r.tocMarker) + r.w.output.Truncate(r.tocMarker) // corner case spacing issue if r.flags&CompletePage != 0 {