all repos — grayfriday @ 02a5ce37ff682cb5a979aa7bd6e82a23b9ea8071

blackfriday fork with a few changes

Go style: Html{Block|Span} -> HTML{Block|Span}
Vytautas Ĺ altenis vytas@rtfb.lt
Fri, 01 Apr 2016 13:15:47 +0300
commit

02a5ce37ff682cb5a979aa7bd6e82a23b9ea8071

parent

32802dbae5247c217e17c256cded2960591aa969

5 files changed, 14 insertions(+), 14 deletions(-)

jump to
M block.goblock.go

@@ -414,7 +414,7 @@ end := i

for end > 0 && data[end-1] == '\n' { end-- } - finalizeHtmlBlock(p.addBlock(HtmlBlock, data[:end])) + finalizeHtmlBlock(p.addBlock(HTMLBlock, data[:end])) } return i

@@ -437,7 +437,7 @@ end := size

for end > 0 && data[end-1] == '\n' { end-- } - block := p.addBlock(HtmlBlock, data[:end]) + block := p.addBlock(HTMLBlock, data[:end]) finalizeHtmlBlock(block) } return size

@@ -470,7 +470,7 @@ end := size

for end > 0 && data[end-1] == '\n' { end-- } - finalizeHtmlBlock(p.addBlock(HtmlBlock, data[:end])) + finalizeHtmlBlock(p.addBlock(HTMLBlock, data[:end])) } return size }
M html.gohtml.go

@@ -1127,7 +1127,7 @@ r.out(w, tag("del", nil, false))

} else { r.out(w, tag("/del", nil, false)) } - case HtmlSpan: + case HTMLSpan: //if options.safe { // out(w, "<!-- raw HTML omitted -->") //} else {

@@ -1201,7 +1201,7 @@ // TODO: untangle this clusterfuck about when the newlines need

// to be added and when not. if node.Prev != nil { t := node.Prev.Type - if t == HtmlBlock || t == List || t == Paragraph || t == Header || t == CodeBlock || t == BlockQuote || t == HorizontalRule { + if t == HTMLBlock || t == List || t == Paragraph || t == Header || t == CodeBlock || t == BlockQuote || t == HorizontalRule { r.cr(w) } }

@@ -1225,7 +1225,7 @@ r.out(w, tag("/blockquote", nil, false))

r.cr(w) } break - case HtmlBlock: + case HTMLBlock: r.cr(w) r.out(w, node.Literal) r.cr(w)
M inline.goinline.go

@@ -658,7 +658,7 @@ p.currBlock.appendChild(node)

node.appendChild(text(stripMailto(link))) } } else { - htmlTag := NewNode(HtmlSpan) + htmlTag := NewNode(HTMLSpan) htmlTag.Literal = data[:end] p.currBlock.appendChild(htmlTag) }

@@ -782,7 +782,7 @@ }

anchorStr := anchorRe.Find(data[anchorStart:]) if anchorStr != nil { - anchorClose := NewNode(HtmlSpan) + anchorClose := NewNode(HTMLSpan) anchorClose.Literal = anchorStr[offsetFromAnchor:] p.currBlock.appendChild(anchorClose) return len(anchorStr) - offsetFromAnchor
M markdown.gomarkdown.go

@@ -466,7 +466,7 @@ if p.flags&Footnotes == 0 || len(p.notes) == 0 {

return } p.tip = p.doc - finalizeHtmlBlock(p.addBlock(HtmlBlock, []byte(`<div class="footnotes">`))) + finalizeHtmlBlock(p.addBlock(HTMLBlock, []byte(`<div class="footnotes">`))) p.addBlock(HorizontalRule, nil) block := p.addBlock(List, nil) block.ListFlags = ListTypeOrdered

@@ -492,7 +492,7 @@ }

above := block.Parent finalizeList(block) p.tip = above - finalizeHtmlBlock(p.addBlock(HtmlBlock, []byte("</div>"))) + finalizeHtmlBlock(p.addBlock(HTMLBlock, []byte("</div>"))) block.Walk(func(node *Node, entering bool) { if node.Type == Paragraph || node.Type == Header { p.currBlock = node
M node.gonode.go

@@ -21,12 +21,12 @@ Del

Link Image Text - HtmlBlock + HTMLBlock CodeBlock Softbreak Hardbreak Code - HtmlSpan + HTMLSpan Table TableCell TableHead

@@ -48,12 +48,12 @@ Del: "Del",

Link: "Link", Image: "Image", Text: "Text", - HtmlBlock: "HtmlBlock", + HTMLBlock: "HTMLBlock", CodeBlock: "CodeBlock", Softbreak: "Softbreak", Hardbreak: "Hardbreak", Code: "Code", - HtmlSpan: "HtmlSpan", + HTMLSpan: "HTMLSpan", Table: "Table", TableCell: "TableCell", TableHead: "TableHead",