all repos — grayfriday @ 793fee5451fe853b7bd45ef35eb06c04522eafad

blackfriday fork with a few changes

preparing for switch to rendering interface
Russ Ross russ@dixie.edu
Wed, 29 Jun 2011 10:43:10 -0600
commit

793fee5451fe853b7bd45ef35eb06c04522eafad

parent

55697351d0212e427d9066c27cc1770735ea5d34

2 files changed, 19 insertions(+), 4 deletions(-)

jump to
M html.gohtml.go

@@ -58,6 +58,7 @@

func HtmlRenderer(flags int, title string, css string) *Renderer { // configure the rendering engine r := new(Renderer) + r.BlockCode = htmlBlockCode r.BlockQuote = htmlBlockQuote r.BlockHtml = htmlBlockHtml
M latex.golatex.go

@@ -20,11 +20,13 @@ "bytes"

) func LatexRenderer(flags int) *Renderer { - // block-level rendering + // configure the rendering engine r := new(Renderer) + + // block-level rendering r.BlockCode = latexBlockCode r.BlockQuote = latexBlockQuote - //r.BlockHtml = ? + r.BlockHtml = latexBlockHtml r.Header = latexHeader r.HRule = latexHRule r.List = latexList

@@ -42,9 +44,11 @@ r.Emphasis = latexEmphasis

r.Image = latexImage r.LineBreak = latexLineBreak r.Link = latexLink - //r.rawHtmlTag = ? + r.RawHtmlTag = latexRawHtmlTag + r.TripleEmphasis = latexTripleEmphasis r.StrikeThrough = latexStrikeThrough + r.Entity = latexEntity r.NormalText = latexNormalText r.DocumentHeader = latexDocumentHeader

@@ -77,7 +81,12 @@ out.Write(text)

out.WriteString("\n\\end{quotation}\n") } -//BlockHtml func(out *bytes.Buffer, text []byte, opaque interface{}) +func latexBlockHtml(out *bytes.Buffer, text []byte, opaque interface{}) { + // a pretty lame thing to do... + out.WriteString("\n\\begin{verbatim}\n") + out.Write(text) + out.WriteString("\n\\end{verbatim}\n") +} func latexHeader(out *bytes.Buffer, text func() bool, level int, opaque interface{}) { marker := out.Len()

@@ -282,6 +291,11 @@ }

out.WriteByte('\\') out.WriteByte(text[i]) } +} + +func latexEntity(out *bytes.Buffer, entity []byte, opaque interface{}) { + // TODO: convert this into a unicode character or something + out.Write(entity) } func latexNormalText(out *bytes.Buffer, text []byte, opaque interface{}) {