mirror of
https://github.com/danog/blackfriday.git
synced 2025-01-23 05:41:27 +01:00
Implement SkipImages and add test
This commit is contained in:
parent
9da90c5929
commit
fecfec2059
3
html.go
3
html.go
@ -1170,6 +1170,9 @@ func (r *HTML) RenderNode(w io.Writer, node *Node, entering bool) WalkStatus {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
case Image:
|
case Image:
|
||||||
|
if r.flags&SkipImages != 0 {
|
||||||
|
return SkipChildren
|
||||||
|
}
|
||||||
if entering {
|
if entering {
|
||||||
dest := node.LinkData.Destination
|
dest := node.LinkData.Destination
|
||||||
dest = r.addAbsPrefix(dest)
|
dest = r.addAbsPrefix(dest)
|
||||||
|
@ -1130,6 +1130,15 @@ func TestSkipLinks(t *testing.T) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func TestSkipImages(t *testing.T) {
|
||||||
|
doTestsInlineParam(t, []string{
|
||||||
|
"![foo](/bar/)\n",
|
||||||
|
"<p></p>\n",
|
||||||
|
}, TestParams{
|
||||||
|
HTMLFlags: SkipImages,
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
func TestUseXHTML(t *testing.T) {
|
func TestUseXHTML(t *testing.T) {
|
||||||
doTestsParam(t, []string{
|
doTestsParam(t, []string{
|
||||||
"---",
|
"---",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user