all repos — grayfriday @ 6d6be3d2b25b61da82ba5d55a493da404f363bda

blackfriday fork with a few changes

Remove callback from Paragraph renderer event

Split Paragraph into two events: BeginParagraph and EndParagraph,
removing the need for callback.
Vytautas Ĺ altenis vytas@rtfb.lt
Mon, 26 Oct 2015 20:35:42 +0200
commit

6d6be3d2b25b61da82ba5d55a493da404f363bda

parent

af1b26fa0429f4f0393ee865a693a2a0746d3e75

4 files changed, 13 insertions(+), 10 deletions(-)

jump to
M block.goblock.go

@@ -1269,10 +1269,9 @@ for end > beg && data[end-1] == ' ' {

end-- } - work := func() { - p.inline(out, data[beg:end]) - } - p.r.Paragraph(out, work) + p.r.BeginParagraph(out) + p.inline(out, data[beg:end]) + p.r.EndParagraph(out) } func (p *parser) paragraph(out *bytes.Buffer, data []byte) int {
M html.gohtml.go

@@ -418,11 +418,12 @@ out.WriteString("</li>\n")

} } -func (options *Html) Paragraph(out *bytes.Buffer, text func()) { +func (r *Html) BeginParagraph(out *bytes.Buffer) { doubleSpace(out) + out.WriteString("<p>") +} - out.WriteString("<p>") - text() +func (r *Html) EndParagraph(out *bytes.Buffer) { out.WriteString("</p>\n") }
M latex.golatex.go

@@ -119,9 +119,11 @@ out.WriteString("\n\\item ")

out.Write(text) } -func (options *Latex) Paragraph(out *bytes.Buffer, text func()) { +func (r *Latex) BeginParagraph(out *bytes.Buffer) { out.WriteString("\n") - text() +} + +func (r *Latex) EndParagraph(out *bytes.Buffer) { out.WriteString("\n") }
M markdown.gomarkdown.go

@@ -169,7 +169,8 @@ HRule(out *bytes.Buffer)

BeginList(out *bytes.Buffer, flags ListType) EndList(out *bytes.Buffer, flags ListType) ListItem(out *bytes.Buffer, text []byte, flags ListType) - Paragraph(out *bytes.Buffer, text func()) + BeginParagraph(out *bytes.Buffer) + EndParagraph(out *bytes.Buffer) Table(out *bytes.Buffer, header []byte, body []byte, columnData []int) TableRow(out *bytes.Buffer, text []byte) TableHeaderCell(out *bytes.Buffer, text []byte, flags int)