mirror of
https://github.com/status-im/markdown.git
synced 2025-02-23 00:28:25 +00:00
simplify inline callback interface
This commit is contained in:
parent
8b9cd447d7
commit
2aca667078
61
html.go
61
html.go
@ -374,12 +374,12 @@ func (options *Html) Paragraph(out *bytes.Buffer, text func() bool) {
|
|||||||
out.WriteString("</p>\n")
|
out.WriteString("</p>\n")
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Html) AutoLink(out *bytes.Buffer, link []byte, kind int) bool {
|
func (options *Html) AutoLink(out *bytes.Buffer, link []byte, kind int) {
|
||||||
if len(link) == 0 {
|
if len(link) == 0 {
|
||||||
return false
|
return
|
||||||
}
|
}
|
||||||
if options.flags&HTML_SAFELINK != 0 && !isSafeLink(link) && kind != LINK_TYPE_EMAIL {
|
if options.flags&HTML_SAFELINK != 0 && !isSafeLink(link) && kind != LINK_TYPE_EMAIL {
|
||||||
return false
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
out.WriteString("<a href=\"")
|
out.WriteString("<a href=\"")
|
||||||
@ -404,44 +404,39 @@ func (options *Html) AutoLink(out *bytes.Buffer, link []byte, kind int) bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
out.WriteString("</a>")
|
out.WriteString("</a>")
|
||||||
|
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Html) CodeSpan(out *bytes.Buffer, text []byte) bool {
|
func (options *Html) CodeSpan(out *bytes.Buffer, text []byte) {
|
||||||
out.WriteString("<code>")
|
out.WriteString("<code>")
|
||||||
attrEscape(out, text)
|
attrEscape(out, text)
|
||||||
out.WriteString("</code>")
|
out.WriteString("</code>")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Html) DoubleEmphasis(out *bytes.Buffer, text []byte) bool {
|
func (options *Html) DoubleEmphasis(out *bytes.Buffer, text []byte) {
|
||||||
if len(text) == 0 {
|
if len(text) == 0 {
|
||||||
return false
|
return
|
||||||
}
|
}
|
||||||
out.WriteString("<strong>")
|
out.WriteString("<strong>")
|
||||||
out.Write(text)
|
out.Write(text)
|
||||||
out.WriteString("</strong>")
|
out.WriteString("</strong>")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Html) Emphasis(out *bytes.Buffer, text []byte) bool {
|
func (options *Html) Emphasis(out *bytes.Buffer, text []byte) {
|
||||||
if len(text) == 0 {
|
if len(text) == 0 {
|
||||||
return false
|
return
|
||||||
}
|
}
|
||||||
out.WriteString("<em>")
|
out.WriteString("<em>")
|
||||||
out.Write(text)
|
out.Write(text)
|
||||||
out.WriteString("</em>")
|
out.WriteString("</em>")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Html) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) bool {
|
func (options *Html) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {
|
||||||
if options.flags&HTML_SKIP_IMAGES != 0 {
|
if options.flags&HTML_SKIP_IMAGES != 0 {
|
||||||
return false
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if len(link) == 0 {
|
if len(link) == 0 {
|
||||||
return false
|
return
|
||||||
}
|
}
|
||||||
out.WriteString("<img src=\"")
|
out.WriteString("<img src=\"")
|
||||||
attrEscape(out, link)
|
attrEscape(out, link)
|
||||||
@ -456,22 +451,21 @@ func (options *Html) Image(out *bytes.Buffer, link []byte, title []byte, alt []b
|
|||||||
|
|
||||||
out.WriteByte('"')
|
out.WriteByte('"')
|
||||||
out.WriteString(options.closeTag)
|
out.WriteString(options.closeTag)
|
||||||
return true
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Html) LineBreak(out *bytes.Buffer) bool {
|
func (options *Html) LineBreak(out *bytes.Buffer) {
|
||||||
out.WriteString("<br")
|
out.WriteString("<br")
|
||||||
out.WriteString(options.closeTag)
|
out.WriteString(options.closeTag)
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Html) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) bool {
|
func (options *Html) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) {
|
||||||
if options.flags&HTML_SKIP_LINKS != 0 {
|
if options.flags&HTML_SKIP_LINKS != 0 {
|
||||||
return false
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if options.flags&HTML_SAFELINK != 0 && !isSafeLink(link) {
|
if options.flags&HTML_SAFELINK != 0 && !isSafeLink(link) {
|
||||||
return false
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
out.WriteString("<a href=\"")
|
out.WriteString("<a href=\"")
|
||||||
@ -483,44 +477,41 @@ func (options *Html) Link(out *bytes.Buffer, link []byte, title []byte, content
|
|||||||
out.WriteString("\">")
|
out.WriteString("\">")
|
||||||
out.Write(content)
|
out.Write(content)
|
||||||
out.WriteString("</a>")
|
out.WriteString("</a>")
|
||||||
return true
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Html) RawHtmlTag(out *bytes.Buffer, text []byte) bool {
|
func (options *Html) RawHtmlTag(out *bytes.Buffer, text []byte) {
|
||||||
if options.flags&HTML_SKIP_HTML != 0 {
|
if options.flags&HTML_SKIP_HTML != 0 {
|
||||||
return true
|
return
|
||||||
}
|
}
|
||||||
if options.flags&HTML_SKIP_STYLE != 0 && isHtmlTag(text, "style") {
|
if options.flags&HTML_SKIP_STYLE != 0 && isHtmlTag(text, "style") {
|
||||||
return true
|
return
|
||||||
}
|
}
|
||||||
if options.flags&HTML_SKIP_LINKS != 0 && isHtmlTag(text, "a") {
|
if options.flags&HTML_SKIP_LINKS != 0 && isHtmlTag(text, "a") {
|
||||||
return true
|
return
|
||||||
}
|
}
|
||||||
if options.flags&HTML_SKIP_IMAGES != 0 && isHtmlTag(text, "img") {
|
if options.flags&HTML_SKIP_IMAGES != 0 && isHtmlTag(text, "img") {
|
||||||
return true
|
return
|
||||||
}
|
}
|
||||||
out.Write(text)
|
out.Write(text)
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Html) TripleEmphasis(out *bytes.Buffer, text []byte) bool {
|
func (options *Html) TripleEmphasis(out *bytes.Buffer, text []byte) {
|
||||||
if len(text) == 0 {
|
if len(text) == 0 {
|
||||||
return false
|
return
|
||||||
}
|
}
|
||||||
out.WriteString("<strong><em>")
|
out.WriteString("<strong><em>")
|
||||||
out.Write(text)
|
out.Write(text)
|
||||||
out.WriteString("</em></strong>")
|
out.WriteString("</em></strong>")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Html) StrikeThrough(out *bytes.Buffer, text []byte) bool {
|
func (options *Html) StrikeThrough(out *bytes.Buffer, text []byte) {
|
||||||
if len(text) == 0 {
|
if len(text) == 0 {
|
||||||
return false
|
return
|
||||||
}
|
}
|
||||||
out.WriteString("<del>")
|
out.WriteString("<del>")
|
||||||
out.Write(text)
|
out.Write(text)
|
||||||
out.WriteString("</del>")
|
out.WriteString("</del>")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Html) Entity(out *bytes.Buffer, entity []byte) {
|
func (options *Html) Entity(out *bytes.Buffer, entity []byte) {
|
||||||
|
61
inline.go
61
inline.go
@ -139,9 +139,7 @@ func inlineCodeSpan(parser *Parser, out *bytes.Buffer, data []byte, offset int)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// render the code span
|
// render the code span
|
||||||
if !parser.r.CodeSpan(out, data[fBegin:fEnd]) {
|
parser.r.CodeSpan(out, data[fBegin:fEnd])
|
||||||
end = 0
|
|
||||||
}
|
|
||||||
|
|
||||||
return end
|
return end
|
||||||
|
|
||||||
@ -164,13 +162,8 @@ func inlineLineBreak(parser *Parser, out *bytes.Buffer, data []byte, offset int)
|
|||||||
return 0
|
return 0
|
||||||
}
|
}
|
||||||
|
|
||||||
if parser.r.LineBreak(out) {
|
parser.r.LineBreak(out)
|
||||||
return 1
|
return 1
|
||||||
} else {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// '[': parse a link or an image
|
// '[': parse a link or an image
|
||||||
@ -415,8 +408,12 @@ func inlineLink(parser *Parser, out *bytes.Buffer, data []byte, offset int) int
|
|||||||
uLink = uLinkBuf.Bytes()
|
uLink = uLinkBuf.Bytes()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// links need something to click on and somewhere to go
|
||||||
|
if len(uLink) == 0 || content.Len() == 0 {
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
|
||||||
// call the relevant rendering function
|
// call the relevant rendering function
|
||||||
ret := false
|
|
||||||
if isImg {
|
if isImg {
|
||||||
outSize := out.Len()
|
outSize := out.Len()
|
||||||
outBytes := out.Bytes()
|
outBytes := out.Bytes()
|
||||||
@ -424,15 +421,12 @@ func inlineLink(parser *Parser, out *bytes.Buffer, data []byte, offset int) int
|
|||||||
out.Truncate(outSize - 1)
|
out.Truncate(outSize - 1)
|
||||||
}
|
}
|
||||||
|
|
||||||
ret = parser.r.Image(out, uLink, title, content.Bytes())
|
parser.r.Image(out, uLink, title, content.Bytes())
|
||||||
} else {
|
} else {
|
||||||
ret = parser.r.Link(out, uLink, title, content.Bytes())
|
parser.r.Link(out, uLink, title, content.Bytes())
|
||||||
}
|
}
|
||||||
|
|
||||||
if ret {
|
return i
|
||||||
return i
|
|
||||||
}
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// '<' when tags or autolinks are allowed
|
// '<' when tags or autolinks are allowed
|
||||||
@ -440,21 +434,17 @@ func inlineLAngle(parser *Parser, out *bytes.Buffer, data []byte, offset int) in
|
|||||||
data = data[offset:]
|
data = data[offset:]
|
||||||
altype := LINK_TYPE_NOT_AUTOLINK
|
altype := LINK_TYPE_NOT_AUTOLINK
|
||||||
end := tagLength(data, &altype)
|
end := tagLength(data, &altype)
|
||||||
ret := false
|
|
||||||
|
|
||||||
if end > 2 {
|
if end > 2 {
|
||||||
if altype != LINK_TYPE_NOT_AUTOLINK {
|
if altype != LINK_TYPE_NOT_AUTOLINK {
|
||||||
var uLink bytes.Buffer
|
var uLink bytes.Buffer
|
||||||
unescapeText(&uLink, data[1:end+1-2])
|
unescapeText(&uLink, data[1:end+1-2])
|
||||||
ret = parser.r.AutoLink(out, uLink.Bytes(), altype)
|
parser.r.AutoLink(out, uLink.Bytes(), altype)
|
||||||
} else {
|
} else {
|
||||||
ret = parser.r.RawHtmlTag(out, data[:end])
|
parser.r.RawHtmlTag(out, data[:end])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !ret {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
return end
|
return end
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -867,11 +857,8 @@ func inlineHelperEmph1(parser *Parser, out *bytes.Buffer, data []byte, c byte) i
|
|||||||
|
|
||||||
var work bytes.Buffer
|
var work bytes.Buffer
|
||||||
parser.parseInline(&work, data[:i])
|
parser.parseInline(&work, data[:i])
|
||||||
if parser.r.Emphasis(out, work.Bytes()) {
|
parser.r.Emphasis(out, work.Bytes())
|
||||||
return i + 1
|
return i + 1
|
||||||
} else {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -891,19 +878,14 @@ func inlineHelperEmph2(parser *Parser, out *bytes.Buffer, data []byte, c byte) i
|
|||||||
if i+1 < len(data) && data[i] == c && data[i+1] == c && i > 0 && !isspace(data[i-1]) {
|
if i+1 < len(data) && data[i] == c && data[i+1] == c && i > 0 && !isspace(data[i-1]) {
|
||||||
var work bytes.Buffer
|
var work bytes.Buffer
|
||||||
parser.parseInline(&work, data[:i])
|
parser.parseInline(&work, data[:i])
|
||||||
success := false
|
|
||||||
|
|
||||||
// pick the right renderer
|
// pick the right renderer
|
||||||
if c == '~' {
|
if c == '~' {
|
||||||
success = parser.r.StrikeThrough(out, work.Bytes())
|
parser.r.StrikeThrough(out, work.Bytes())
|
||||||
} else {
|
} else {
|
||||||
success = parser.r.DoubleEmphasis(out, work.Bytes())
|
parser.r.DoubleEmphasis(out, work.Bytes())
|
||||||
}
|
|
||||||
if success {
|
|
||||||
return i + 2
|
|
||||||
} else {
|
|
||||||
return 0
|
|
||||||
}
|
}
|
||||||
|
return i + 2
|
||||||
}
|
}
|
||||||
i++
|
i++
|
||||||
}
|
}
|
||||||
@ -933,11 +915,8 @@ func inlineHelperEmph3(parser *Parser, out *bytes.Buffer, data []byte, offset in
|
|||||||
var work bytes.Buffer
|
var work bytes.Buffer
|
||||||
|
|
||||||
parser.parseInline(&work, data[:i])
|
parser.parseInline(&work, data[:i])
|
||||||
if parser.r.TripleEmphasis(out, work.Bytes()) {
|
parser.r.TripleEmphasis(out, work.Bytes())
|
||||||
return i + 3
|
return i + 3
|
||||||
} else {
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
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 = inlineHelperEmph1(parser, out, origData[offset-2:], c)
|
length = inlineHelperEmph1(parser, out, origData[offset-2:], c)
|
||||||
|
@ -276,7 +276,7 @@ func TestInlineLink(t *testing.T) {
|
|||||||
"<p><a href=\"/bar/ title with no quotes\">foo with a title</a></p>\n",
|
"<p><a href=\"/bar/ title with no quotes\">foo with a title</a></p>\n",
|
||||||
|
|
||||||
"[foo]()\n",
|
"[foo]()\n",
|
||||||
"<p><a href=\"\">foo</a></p>\n",
|
"<p>[foo]()</p>\n",
|
||||||
|
|
||||||
"\n",
|
"\n",
|
||||||
"<p><img src=\"/bar/\" alt=\"foo\" />\n</p>\n",
|
"<p><img src=\"/bar/\" alt=\"foo\" />\n</p>\n",
|
||||||
@ -294,7 +294,7 @@ func TestInlineLink(t *testing.T) {
|
|||||||
"<p><img src=\"/bar/ title with no quotes\" alt=\"foo with a title\" />\n</p>\n",
|
"<p><img src=\"/bar/ title with no quotes\" alt=\"foo with a title\" />\n</p>\n",
|
||||||
|
|
||||||
"![foo]()\n",
|
"![foo]()\n",
|
||||||
"<p>[foo]()</p>\n",
|
"<p>![foo]()</p>\n",
|
||||||
|
|
||||||
"[a link]\t(/with_a_tab/)\n",
|
"[a link]\t(/with_a_tab/)\n",
|
||||||
"<p><a href=\"/with_a_tab/\">a link</a></p>\n",
|
"<p><a href=\"/with_a_tab/\">a link</a></p>\n",
|
||||||
|
30
latex.go
30
latex.go
@ -151,7 +151,7 @@ func (options *Latex) TableCell(out *bytes.Buffer, text []byte, align int) {
|
|||||||
out.Write(text)
|
out.Write(text)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Latex) AutoLink(out *bytes.Buffer, link []byte, kind int) bool {
|
func (options *Latex) AutoLink(out *bytes.Buffer, link []byte, kind int) {
|
||||||
out.WriteString("\\href{")
|
out.WriteString("\\href{")
|
||||||
if kind == LINK_TYPE_EMAIL {
|
if kind == LINK_TYPE_EMAIL {
|
||||||
out.WriteString("mailto:")
|
out.WriteString("mailto:")
|
||||||
@ -160,31 +160,27 @@ func (options *Latex) AutoLink(out *bytes.Buffer, link []byte, kind int) bool {
|
|||||||
out.WriteString("}{")
|
out.WriteString("}{")
|
||||||
out.Write(link)
|
out.Write(link)
|
||||||
out.WriteString("}")
|
out.WriteString("}")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Latex) CodeSpan(out *bytes.Buffer, text []byte) bool {
|
func (options *Latex) CodeSpan(out *bytes.Buffer, text []byte) {
|
||||||
out.WriteString("\\texttt{")
|
out.WriteString("\\texttt{")
|
||||||
escapeSpecialChars(out, text)
|
escapeSpecialChars(out, text)
|
||||||
out.WriteString("}")
|
out.WriteString("}")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Latex) DoubleEmphasis(out *bytes.Buffer, text []byte) bool {
|
func (options *Latex) DoubleEmphasis(out *bytes.Buffer, text []byte) {
|
||||||
out.WriteString("\\textbf{")
|
out.WriteString("\\textbf{")
|
||||||
out.Write(text)
|
out.Write(text)
|
||||||
out.WriteString("}")
|
out.WriteString("}")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Latex) Emphasis(out *bytes.Buffer, text []byte) bool {
|
func (options *Latex) Emphasis(out *bytes.Buffer, text []byte) {
|
||||||
out.WriteString("\\textit{")
|
out.WriteString("\\textit{")
|
||||||
out.Write(text)
|
out.Write(text)
|
||||||
out.WriteString("}")
|
out.WriteString("}")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Latex) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) bool {
|
func (options *Latex) Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) {
|
||||||
if bytes.HasPrefix(link, []byte("http://")) || bytes.HasPrefix(link, []byte("https://")) {
|
if bytes.HasPrefix(link, []byte("http://")) || bytes.HasPrefix(link, []byte("https://")) {
|
||||||
// treat it like a link
|
// treat it like a link
|
||||||
out.WriteString("\\href{")
|
out.WriteString("\\href{")
|
||||||
@ -197,39 +193,33 @@ func (options *Latex) Image(out *bytes.Buffer, link []byte, title []byte, alt []
|
|||||||
out.Write(link)
|
out.Write(link)
|
||||||
out.WriteString("}")
|
out.WriteString("}")
|
||||||
}
|
}
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Latex) LineBreak(out *bytes.Buffer) bool {
|
func (options *Latex) LineBreak(out *bytes.Buffer) {
|
||||||
out.WriteString(" \\\\\n")
|
out.WriteString(" \\\\\n")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Latex) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) bool {
|
func (options *Latex) Link(out *bytes.Buffer, link []byte, title []byte, content []byte) {
|
||||||
out.WriteString("\\href{")
|
out.WriteString("\\href{")
|
||||||
out.Write(link)
|
out.Write(link)
|
||||||
out.WriteString("}{")
|
out.WriteString("}{")
|
||||||
out.Write(content)
|
out.Write(content)
|
||||||
out.WriteString("}")
|
out.WriteString("}")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Latex) RawHtmlTag(out *bytes.Buffer, tag []byte) bool {
|
func (options *Latex) RawHtmlTag(out *bytes.Buffer, tag []byte) {
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Latex) TripleEmphasis(out *bytes.Buffer, text []byte) bool {
|
func (options *Latex) TripleEmphasis(out *bytes.Buffer, text []byte) {
|
||||||
out.WriteString("\\textbf{\\textit{")
|
out.WriteString("\\textbf{\\textit{")
|
||||||
out.Write(text)
|
out.Write(text)
|
||||||
out.WriteString("}}")
|
out.WriteString("}}")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func (options *Latex) StrikeThrough(out *bytes.Buffer, text []byte) bool {
|
func (options *Latex) StrikeThrough(out *bytes.Buffer, text []byte) {
|
||||||
out.WriteString("\\sout{")
|
out.WriteString("\\sout{")
|
||||||
out.Write(text)
|
out.Write(text)
|
||||||
out.WriteString("}")
|
out.WriteString("}")
|
||||||
return true
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func needsBackslash(c byte) bool {
|
func needsBackslash(c byte) bool {
|
||||||
|
22
markdown.go
22
markdown.go
@ -114,17 +114,17 @@ type Renderer interface {
|
|||||||
TableRow(out *bytes.Buffer, text []byte)
|
TableRow(out *bytes.Buffer, text []byte)
|
||||||
TableCell(out *bytes.Buffer, text []byte, flags int)
|
TableCell(out *bytes.Buffer, text []byte, flags int)
|
||||||
|
|
||||||
// Span-level callbacks---return false prints the span verbatim
|
// Span-level callbacks
|
||||||
AutoLink(out *bytes.Buffer, link []byte, kind int) bool
|
AutoLink(out *bytes.Buffer, link []byte, kind int)
|
||||||
CodeSpan(out *bytes.Buffer, text []byte) bool
|
CodeSpan(out *bytes.Buffer, text []byte)
|
||||||
DoubleEmphasis(out *bytes.Buffer, text []byte) bool
|
DoubleEmphasis(out *bytes.Buffer, text []byte)
|
||||||
Emphasis(out *bytes.Buffer, text []byte) bool
|
Emphasis(out *bytes.Buffer, text []byte)
|
||||||
Image(out *bytes.Buffer, link []byte, title []byte, alt []byte) bool
|
Image(out *bytes.Buffer, link []byte, title []byte, alt []byte)
|
||||||
LineBreak(out *bytes.Buffer) bool
|
LineBreak(out *bytes.Buffer)
|
||||||
Link(out *bytes.Buffer, link []byte, title []byte, content []byte) bool
|
Link(out *bytes.Buffer, link []byte, title []byte, content []byte)
|
||||||
RawHtmlTag(out *bytes.Buffer, tag []byte) bool
|
RawHtmlTag(out *bytes.Buffer, tag []byte)
|
||||||
TripleEmphasis(out *bytes.Buffer, text []byte) bool
|
TripleEmphasis(out *bytes.Buffer, text []byte)
|
||||||
StrikeThrough(out *bytes.Buffer, text []byte) bool
|
StrikeThrough(out *bytes.Buffer, text []byte)
|
||||||
|
|
||||||
// Low-level callbacks
|
// Low-level callbacks
|
||||||
Entity(out *bytes.Buffer, entity []byte)
|
Entity(out *bytes.Buffer, entity []byte)
|
||||||
|
@ -8,4 +8,4 @@
|
|||||||
|
|
||||||
<p><a href="/url/" title="title has spaces afterward">URL and title</a>.</p>
|
<p><a href="/url/" title="title has spaces afterward">URL and title</a>.</p>
|
||||||
|
|
||||||
<p><a href="">Empty</a>.</p>
|
<p>[Empty]().</p>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user