Remove a bunch of 'out' parameters from calls, WIP

Still not all of them, still broken.
This commit is contained in:
Vytautas Šaltenis 2015-11-01 21:57:30 +02:00
parent 7ec50399c3
commit 352ffdefa4
3 changed files with 78 additions and 78 deletions

View File

@ -42,7 +42,7 @@ func (p *parser) block(data []byte) {
// ... // ...
// ###### Header 6 // ###### Header 6
if p.isPrefixHeader(data) { if p.isPrefixHeader(data) {
data = data[p.prefixHeader(out, data):] data = data[p.prefixHeader(data):]
continue continue
} }
@ -52,7 +52,7 @@ func (p *parser) block(data []byte) {
// ... // ...
// </div> // </div>
if data[0] == '<' { if data[0] == '<' {
if i := p.html(out, data, true); i > 0 { if i := p.html(data, true); i > 0 {
data = data[i:] data = data[i:]
continue continue
} }
@ -65,7 +65,7 @@ func (p *parser) block(data []byte) {
// % even more stuff // % even more stuff
if p.flags&Titleblock != 0 { if p.flags&Titleblock != 0 {
if data[0] == '%' { if data[0] == '%' {
if i := p.titleBlock(out, data, true); i > 0 { if i := p.titleBlock(data, true); i > 0 {
data = data[i:] data = data[i:]
continue continue
} }
@ -87,7 +87,7 @@ func (p *parser) block(data []byte) {
// return b // return b
// } // }
if p.codePrefix(data) > 0 { if p.codePrefix(data) > 0 {
data = data[p.code(out, data):] data = data[p.code(data):]
continue continue
} }
@ -102,7 +102,7 @@ func (p *parser) block(data []byte) {
// } // }
// ``` // ```
if p.flags&FencedCode != 0 { if p.flags&FencedCode != 0 {
if i := p.fencedCode(out, data, true); i > 0 { if i := p.fencedCode(data, true); i > 0 {
data = data[i:] data = data[i:]
continue continue
} }
@ -116,7 +116,7 @@ func (p *parser) block(data []byte) {
// or // or
// ______ // ______
if p.isHRule(data) { if p.isHRule(data) {
p.r.HRule(out) p.r.HRule()
var i int var i int
for i = 0; data[i] != '\n'; i++ { for i = 0; data[i] != '\n'; i++ {
} }
@ -129,7 +129,7 @@ func (p *parser) block(data []byte) {
// > A big quote I found somewhere // > A big quote I found somewhere
// > on the web // > on the web
if p.quotePrefix(data) > 0 { if p.quotePrefix(data) > 0 {
data = data[p.quote(out, data):] data = data[p.quote(data):]
continue continue
} }
@ -140,7 +140,7 @@ func (p *parser) block(data []byte) {
// Bob | 31 | 555-1234 // Bob | 31 | 555-1234
// Alice | 27 | 555-4321 // Alice | 27 | 555-4321
if p.flags&Tables != 0 { if p.flags&Tables != 0 {
if i := p.table(out, data); i > 0 { if i := p.table(data); i > 0 {
data = data[i:] data = data[i:]
continue continue
} }
@ -153,7 +153,7 @@ func (p *parser) block(data []byte) {
// //
// also works with + or - // also works with + or -
if p.uliPrefix(data) > 0 { if p.uliPrefix(data) > 0 {
data = data[p.list(out, data, 0):] data = data[p.list(data, 0):]
continue continue
} }
@ -162,7 +162,7 @@ func (p *parser) block(data []byte) {
// 1. Item 1 // 1. Item 1
// 2. Item 2 // 2. Item 2
if p.oliPrefix(data) > 0 { if p.oliPrefix(data) > 0 {
data = data[p.list(out, data, ListTypeOrdered):] data = data[p.list(data, ListTypeOrdered):]
continue continue
} }
@ -176,14 +176,14 @@ func (p *parser) block(data []byte) {
// : Definition c // : Definition c
if p.flags&DefinitionLists != 0 { if p.flags&DefinitionLists != 0 {
if p.dliPrefix(data) > 0 { if p.dliPrefix(data) > 0 {
data = data[p.list(out, data, ListTypeDefinition):] data = data[p.list(data, ListTypeDefinition):]
continue continue
} }
} }
// anything else must look like a normal paragraph // anything else must look like a normal paragraph
// note: this finds underlined headers, too // note: this finds underlined headers, too
data = data[p.paragraph(out, data):] data = data[p.paragraph(data):]
} }
p.nesting-- p.nesting--
@ -292,7 +292,7 @@ func (p *parser) titleBlock(data []byte, doRender bool) int {
} }
data = bytes.Join(splitData[0:i], []byte("\n")) data = bytes.Join(splitData[0:i], []byte("\n"))
p.r.TitleBlock(out, data) p.r.TitleBlock(data)
return len(data) return len(data)
} }
@ -309,12 +309,12 @@ func (p *parser) html(data []byte, doRender bool) int {
// handle special cases // handle special cases
if !tagfound { if !tagfound {
// check for an HTML comment // check for an HTML comment
if size := p.htmlComment(out, data, doRender); size > 0 { if size := p.htmlComment(data, doRender); size > 0 {
return size return size
} }
// check for an <hr> tag // check for an <hr> tag
if size := p.htmlHr(out, data, doRender); size > 0 { if size := p.htmlHr(data, doRender); size > 0 {
return size return size
} }
@ -389,7 +389,7 @@ func (p *parser) html(data []byte, doRender bool) int {
for end > 0 && data[end-1] == '\n' { for end > 0 && data[end-1] == '\n' {
end-- end--
} }
p.r.BlockHtml(out, data[:end]) p.r.BlockHtml(data[:end])
} }
return i return i
@ -397,7 +397,7 @@ func (p *parser) html(data []byte, doRender bool) int {
// HTML comment, lax form // HTML comment, lax form
func (p *parser) htmlComment(data []byte, doRender bool) int { func (p *parser) htmlComment(data []byte, doRender bool) int {
i := p.inlineHtmlComment(out, data) i := p.inlineHtmlComment(data)
// needs to end with a blank line // needs to end with a blank line
if j := p.isEmpty(data[i:]); j > 0 { if j := p.isEmpty(data[i:]); j > 0 {
size := i + j size := i + j
@ -407,7 +407,7 @@ func (p *parser) htmlComment(data []byte, doRender bool) int {
for end > 0 && data[end-1] == '\n' { for end > 0 && data[end-1] == '\n' {
end-- end--
} }
p.r.BlockHtml(out, data[:end]) p.r.BlockHtml(data[:end])
} }
return size return size
} }
@ -439,7 +439,7 @@ func (p *parser) htmlHr(data []byte, doRender bool) int {
for end > 0 && data[end-1] == '\n' { for end > 0 && data[end-1] == '\n' {
end-- end--
} }
p.r.BlockHtml(out, data[:end]) p.r.BlockHtml(data[:end])
} }
return size return size
} }
@ -672,7 +672,7 @@ func (p *parser) fencedCode(data []byte, doRender bool) int {
} }
if doRender { if doRender {
p.r.BlockCode(out, work.Bytes(), syntax) p.r.BlockCode(work.Bytes(), syntax)
} }
return beg return beg
@ -705,7 +705,7 @@ func (p *parser) table(data []byte) int {
p.tableRow(&body, data[rowStart:i], columns, false) p.tableRow(&body, data[rowStart:i], columns, false)
} }
p.r.Table(out, header.Bytes(), body.Bytes(), columns) p.r.Table(header.Bytes(), body.Bytes(), columns)
return i return i
} }
@ -871,7 +871,7 @@ func (p *parser) tableRow(out *bytes.Buffer, data []byte, columns []int, header
// silently ignore rows with too many cells // silently ignore rows with too many cells
p.r.TableRow(out, rowWork.Bytes()) p.r.TableRow(rowWork.Bytes())
} }
// returns blockquote prefix length // returns blockquote prefix length
@ -912,7 +912,7 @@ func (p *parser) quote(data []byte) int {
// irregardless of any contents inside it // irregardless of any contents inside it
for data[end] != '\n' { for data[end] != '\n' {
if p.flags&FencedCode != 0 { if p.flags&FencedCode != 0 {
if i := p.fencedCode(out, data[end:], false); i > 0 { if i := p.fencedCode(data[end:], false); i > 0 {
// -1 to compensate for the extra end++ after the loop: // -1 to compensate for the extra end++ after the loop:
end += i - 1 end += i - 1
break break
@ -936,7 +936,7 @@ func (p *parser) quote(data []byte) int {
var cooked bytes.Buffer var cooked bytes.Buffer
p.block(&cooked, raw.Bytes()) p.block(&cooked, raw.Bytes())
p.r.BlockQuote(out, cooked.Bytes()) p.r.BlockQuote(cooked.Bytes())
return end return end
} }
@ -988,7 +988,7 @@ func (p *parser) code(data []byte) int {
work.WriteByte('\n') work.WriteByte('\n')
p.r.BlockCode(out, work.Bytes(), "") p.r.BlockCode(work.Bytes(), "")
return i return i
} }
@ -1050,10 +1050,10 @@ func (p *parser) dliPrefix(data []byte) int {
func (p *parser) list(data []byte, flags ListType) int { func (p *parser) list(data []byte, flags ListType) int {
i := 0 i := 0
flags |= ListItemBeginningOfList flags |= ListItemBeginningOfList
p.r.BeginList(out, flags) p.r.BeginList(flags)
for i < len(data) { for i < len(data) {
skip := p.listItem(out, data[i:], &flags) skip := p.listItem(data[i:], &flags)
i += skip i += skip
if skip == 0 || flags&ListItemEndOfList != 0 { if skip == 0 || flags&ListItemEndOfList != 0 {
break break
@ -1061,7 +1061,7 @@ func (p *parser) list(data []byte, flags ListType) int {
flags &= ^ListItemBeginningOfList flags &= ^ListItemBeginningOfList
} }
p.r.EndList(out, flags) p.r.EndList(flags)
return i return i
} }
@ -1244,7 +1244,7 @@ gatherlines:
for parsedEnd > 0 && cookedBytes[parsedEnd-1] == '\n' { for parsedEnd > 0 && cookedBytes[parsedEnd-1] == '\n' {
parsedEnd-- parsedEnd--
} }
p.r.ListItem(out, cookedBytes[:parsedEnd], *flags) p.r.ListItem(cookedBytes[:parsedEnd], *flags)
return line return line
} }
@ -1269,9 +1269,9 @@ func (p *parser) renderParagraph(data []byte) {
end-- end--
} }
p.r.BeginParagraph(out) p.r.BeginParagraph()
p.inline(out, data[beg:end]) p.inline(data[beg:end])
p.r.EndParagraph(out) p.r.EndParagraph()
} }
func (p *parser) paragraph(data []byte) int { func (p *parser) paragraph(data []byte) int {
@ -1292,11 +1292,11 @@ func (p *parser) paragraph(data []byte) int {
// did this blank line followed by a definition list item? // did this blank line followed by a definition list item?
if p.flags&DefinitionLists != 0 { if p.flags&DefinitionLists != 0 {
if i < len(data)-1 && data[i+1] == ':' { if i < len(data)-1 && data[i+1] == ':' {
return p.list(out, data[prev:], ListTypeDefinition) return p.list(data[prev:], ListTypeDefinition)
} }
} }
p.renderParagraph(out, data[:i]) p.renderParagraph(data[:i])
return i + n return i + n
} }
@ -1304,7 +1304,7 @@ func (p *parser) paragraph(data []byte) int {
if i > 0 { if i > 0 {
if level := p.isUnderlinedHeader(current); level > 0 { if level := p.isUnderlinedHeader(current); level > 0 {
// render the paragraph // render the paragraph
p.renderParagraph(out, data[:prev]) p.renderParagraph(data[:prev])
// ignore leading and trailing whitespace // ignore leading and trailing whitespace
eol := i - 1 eol := i - 1
@ -1334,23 +1334,23 @@ func (p *parser) paragraph(data []byte) int {
// if the next line starts a block of HTML, then the paragraph ends here // if the next line starts a block of HTML, then the paragraph ends here
if p.flags&LaxHTMLBlocks != 0 { if p.flags&LaxHTMLBlocks != 0 {
if data[i] == '<' && p.html(out, current, false) > 0 { if data[i] == '<' && p.html(current, false) > 0 {
// rewind to before the HTML block // rewind to before the HTML block
p.renderParagraph(out, data[:i]) p.renderParagraph(data[:i])
return i return i
} }
} }
// if there's a prefixed header or a horizontal rule after this, paragraph is over // if there's a prefixed header or a horizontal rule after this, paragraph is over
if p.isPrefixHeader(current) || p.isHRule(current) { if p.isPrefixHeader(current) || p.isHRule(current) {
p.renderParagraph(out, data[:i]) p.renderParagraph(data[:i])
return i return i
} }
// if there's a fenced code block, paragraph is over // if there's a fenced code block, paragraph is over
if p.flags&FencedCode != 0 { if p.flags&FencedCode != 0 {
if p.fencedCode(out, current, false) > 0 { if p.fencedCode(current, false) > 0 {
p.renderParagraph(out, data[:i]) p.renderParagraph(data[:i])
return i return i
} }
} }
@ -1358,7 +1358,7 @@ func (p *parser) paragraph(data []byte) int {
// if there's a definition list item, prev line is a definition term // if there's a definition list item, prev line is a definition term
if p.flags&DefinitionLists != 0 { if p.flags&DefinitionLists != 0 {
if p.dliPrefix(current) != 0 { if p.dliPrefix(current) != 0 {
return p.list(out, data[prev:], ListTypeDefinition) return p.list(data[prev:], ListTypeDefinition)
} }
} }
@ -1368,7 +1368,7 @@ func (p *parser) paragraph(data []byte) int {
p.oliPrefix(current) != 0 || p.oliPrefix(current) != 0 ||
p.quotePrefix(current) != 0 || p.quotePrefix(current) != 0 ||
p.codePrefix(current) != 0 { p.codePrefix(current) != 0 {
p.renderParagraph(out, data[:i]) p.renderParagraph(data[:i])
return i return i
} }
} }
@ -1380,6 +1380,6 @@ func (p *parser) paragraph(data []byte) int {
i++ i++
} }
p.renderParagraph(out, data[:i]) p.renderParagraph(data[:i])
return i return i
} }

View File

@ -344,12 +344,12 @@ func (r *Html) TableCell(out *bytes.Buffer, text []byte, align int) {
func (r *Html) BeginFootnotes() { func (r *Html) BeginFootnotes() {
out.WriteString("<div class=\"footnotes\">\n") out.WriteString("<div class=\"footnotes\">\n")
r.HRule(out) r.HRule()
r.BeginList(out, ListTypeOrdered) r.BeginList(ListTypeOrdered)
} }
func (r *Html) EndFootnotes() { func (r *Html) EndFootnotes() {
r.EndList(out, ListTypeOrdered) r.EndList(ListTypeOrdered)
out.WriteString("</div>\n") out.WriteString("</div>\n")
} }
@ -685,7 +685,7 @@ func (r *Html) DocumentHeader() {
} }
out.WriteString("<head>\n") out.WriteString("<head>\n")
out.WriteString(" <title>") out.WriteString(" <title>")
r.NormalText(out, []byte(r.title)) r.NormalText([]byte(r.title))
out.WriteString("</title>\n") out.WriteString("</title>\n")
out.WriteString(" <meta name=\"GENERATOR\" content=\"Blackfriday Markdown Processor v") out.WriteString(" <meta name=\"GENERATOR\" content=\"Blackfriday Markdown Processor v")
out.WriteString(VERSION) out.WriteString(VERSION)

View File

@ -51,11 +51,11 @@ func (p *parser) inline(data []byte) {
// Fix this somehow. // Fix this somehow.
for end < len(data) { for end < len(data) {
if data[end] == ' ' { if data[end] == ' ' {
consumed, br := maybeLineBreak(p, out, data, end) consumed, br := maybeLineBreak(p, data, end)
if consumed > 0 { if consumed > 0 {
p.r.NormalText(out, data[i:end]) p.r.NormalText(data[i:end])
if br { if br {
p.r.LineBreak(out) p.r.LineBreak()
} }
i = end i = end
i += consumed i += consumed
@ -76,7 +76,7 @@ func (p *parser) inline(data []byte) {
} }
} }
p.r.NormalText(out, data[i:end]) p.r.NormalText(data[i:end])
if end >= len(data) { if end >= len(data) {
break break
@ -85,7 +85,7 @@ func (p *parser) inline(data []byte) {
// call the trigger // call the trigger
handler := p.inlineCallback[data[end]] handler := p.inlineCallback[data[end]]
if consumed := handler(p, out, data, i); consumed == 0 { if consumed := handler(p, data, i); consumed == 0 {
// no action from the callback; buffer the byte for later // no action from the callback; buffer the byte for later
end = i + 1 end = i + 1
} else { } else {
@ -110,7 +110,7 @@ func emphasis(p *parser, data []byte, offset int) int {
if c == '~' || isspace(data[1]) { if c == '~' || isspace(data[1]) {
return 0 return 0
} }
if ret = helperEmphasis(p, out, data[1:], c); ret == 0 { if ret = helperEmphasis(p, data[1:], c); ret == 0 {
return 0 return 0
} }
@ -121,7 +121,7 @@ func emphasis(p *parser, data []byte, offset int) int {
if isspace(data[2]) { if isspace(data[2]) {
return 0 return 0
} }
if ret = helperDoubleEmphasis(p, out, data[2:], c); ret == 0 { if ret = helperDoubleEmphasis(p, data[2:], c); ret == 0 {
return 0 return 0
} }
@ -132,7 +132,7 @@ func emphasis(p *parser, data []byte, offset int) int {
if c == '~' || isspace(data[3]) { if c == '~' || isspace(data[3]) {
return 0 return 0
} }
if ret = helperTripleEmphasis(p, out, data, 3, c); ret == 0 { if ret = helperTripleEmphasis(p, data, 3, c); ret == 0 {
return 0 return 0
} }
@ -180,7 +180,7 @@ func codeSpan(p *parser, data []byte, offset int) int {
// render the code span // render the code span
if fBegin != fEnd { if fBegin != fEnd {
p.r.CodeSpan(out, data[fBegin:fEnd]) p.r.CodeSpan(data[fBegin:fEnd])
} }
return end return end
@ -205,7 +205,7 @@ func maybeLineBreak(p *parser, data []byte, offset int) (int, bool) {
// newline without two spaces works when HardLineBreak is enabled // newline without two spaces works when HardLineBreak is enabled
func lineBreak(p *parser, data []byte, offset int) int { func lineBreak(p *parser, data []byte, offset int) int {
if p.flags&HardLineBreak != 0 { if p.flags&HardLineBreak != 0 {
p.r.LineBreak(out) p.r.LineBreak()
return 1 return 1
} }
return 0 return 0
@ -229,14 +229,14 @@ func isReferenceStyleLink(data []byte, pos int, t linkType) bool {
func maybeImage(p *parser, data []byte, offset int) int { func maybeImage(p *parser, data []byte, offset int) int {
if offset < len(data)-1 && data[offset+1] == '[' { if offset < len(data)-1 && data[offset+1] == '[' {
return link(p, out, data, offset) return link(p, data, offset)
} }
return 0 return 0
} }
func maybeInlineFootnote(p *parser, data []byte, offset int) int { func maybeInlineFootnote(p *parser, data []byte, offset int) int {
if offset < len(data)-1 && data[offset+1] == '[' { if offset < len(data)-1 && data[offset+1] == '[' {
return link(p, out, data, offset) return link(p, data, offset)
} }
return 0 return 0
} }
@ -572,21 +572,21 @@ func link(p *parser, data []byte, offset int) int {
switch t { switch t {
case linkNormal: case linkNormal:
if len(altContent) > 0 { if len(altContent) > 0 {
p.r.Link(out, uLink, title, altContent) p.r.Link(uLink, title, altContent)
} else { } else {
p.r.Link(out, uLink, title, content.Bytes()) p.r.Link(uLink, title, content.Bytes())
} }
case linkImg: case linkImg:
p.r.Image(out, uLink, title, content.Bytes()) p.r.Image(uLink, title, content.Bytes())
i += 1 i += 1
case linkInlineFootnote: case linkInlineFootnote:
p.r.FootnoteRef(out, link, noteId) p.r.FootnoteRef(link, noteId)
i += 1 i += 1
case linkDeferredFootnote: case linkDeferredFootnote:
p.r.FootnoteRef(out, link, noteId) p.r.FootnoteRef(link, noteId)
default: default:
return 0 return 0
@ -619,7 +619,7 @@ func leftAngle(p *parser, data []byte, offset int) int {
data = data[offset:] data = data[offset:]
altype := LinkTypeNotAutolink altype := LinkTypeNotAutolink
end := tagLength(data, &altype) end := tagLength(data, &altype)
if size := p.inlineHtmlComment(out, data); size > 0 { if size := p.inlineHtmlComment(data); size > 0 {
end = size end = size
} }
if end > 2 { if end > 2 {
@ -627,10 +627,10 @@ func leftAngle(p *parser, data []byte, offset int) int {
var uLink bytes.Buffer var uLink bytes.Buffer
unescapeText(&uLink, data[1:end+1-2]) unescapeText(&uLink, data[1:end+1-2])
if uLink.Len() > 0 { if uLink.Len() > 0 {
p.r.AutoLink(out, uLink.Bytes(), altype) p.r.AutoLink(uLink.Bytes(), altype)
} }
} else { } else {
p.r.RawHtmlTag(out, data[:end]) p.r.RawHtmlTag(data[:end])
} }
} }
@ -645,14 +645,14 @@ func escape(p *parser, data []byte, offset int) int {
if len(data) > 1 { if len(data) > 1 {
if p.flags&BackslashLineBreak != 0 && data[1] == '\n' { if p.flags&BackslashLineBreak != 0 && data[1] == '\n' {
p.r.LineBreak(out) p.r.LineBreak()
return 2 return 2
} }
if bytes.IndexByte(escapeChars, data[1]) < 0 { if bytes.IndexByte(escapeChars, data[1]) < 0 {
return 0 return 0
} }
p.r.NormalText(out, data[1:2]) p.r.NormalText(data[1:2])
} }
return 2 return 2
@ -700,7 +700,7 @@ func entity(p *parser, data []byte, offset int) int {
return 0 // lone '&' return 0 // lone '&'
} }
p.r.Entity(out, data[:end]) p.r.Entity(data[:end])
return end return end
} }
@ -729,7 +729,7 @@ func maybeAutoLink(p *parser, data []byte, offset int) int {
} }
head := bytes.ToLower(data[offset:endOfHead]) head := bytes.ToLower(data[offset:endOfHead])
if bytes.HasPrefix(head, []byte(prefix)) { if bytes.HasPrefix(head, []byte(prefix)) {
return autoLink(p, out, data, offset) return autoLink(p, data, offset)
} }
} }
return 0 return 0
@ -844,7 +844,7 @@ func autoLink(p *parser, data []byte, offset int) int {
unescapeText(&uLink, data[:linkEnd]) unescapeText(&uLink, data[:linkEnd])
if uLink.Len() > 0 { if uLink.Len() > 0 {
p.r.AutoLink(out, uLink.Bytes(), LinkTypeNormal) p.r.AutoLink(uLink.Bytes(), LinkTypeNormal)
} }
return linkEnd return linkEnd
@ -1101,7 +1101,7 @@ func helperEmphasis(p *parser, data []byte, c byte) int {
var work bytes.Buffer var work bytes.Buffer
p.inline(&work, data[:i]) p.inline(&work, data[:i])
p.r.Emphasis(out, work.Bytes()) p.r.Emphasis(work.Bytes())
return i + 1 return i + 1
} }
} }
@ -1126,9 +1126,9 @@ func helperDoubleEmphasis(p *parser, data []byte, c byte) int {
if work.Len() > 0 { if work.Len() > 0 {
// pick the right renderer // pick the right renderer
if c == '~' { if c == '~' {
p.r.StrikeThrough(out, work.Bytes()) p.r.StrikeThrough(work.Bytes())
} else { } else {
p.r.DoubleEmphasis(out, work.Bytes()) p.r.DoubleEmphasis(work.Bytes())
} }
} }
return i + 2 return i + 2
@ -1162,12 +1162,12 @@ func helperTripleEmphasis(p *parser, data []byte, offset int, c byte) int {
p.inline(&work, data[:i]) p.inline(&work, data[:i])
if work.Len() > 0 { if work.Len() > 0 {
p.r.TripleEmphasis(out, work.Bytes()) p.r.TripleEmphasis(work.Bytes())
} }
return i + 3 return i + 3
case (i+1 < len(data) && data[i+1] == c): case (i+1 < len(data) && data[i+1] == c):
// double symbol found, hand over to emph1 // double symbol found, hand over to emph1
length = helperEmphasis(p, out, origData[offset-2:], c) length = helperEmphasis(p, origData[offset-2:], c)
if length == 0 { if length == 0 {
return 0 return 0
} else { } else {
@ -1175,7 +1175,7 @@ func helperTripleEmphasis(p *parser, data []byte, offset int, c byte) int {
} }
default: default:
// single symbol found, hand over to emph2 // single symbol found, hand over to emph2
length = helperDoubleEmphasis(p, out, origData[offset-1:], c) length = helperDoubleEmphasis(p, origData[offset-1:], c)
if length == 0 { if length == 0 {
return 0 return 0
} else { } else {