mirror of
https://github.com/russross/blackfriday.git
synced 2024-03-22 13:40:34 +08: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:
|
||||
if r.flags&SkipImages != 0 {
|
||||
return SkipChildren
|
||||
}
|
||||
if entering {
|
||||
dest := node.LinkData.Destination
|
||||
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) {
|
||||
doTestsParam(t, []string{
|
||||
"---",
|
||||
|
|
Loading…
Reference in New Issue
Block a user