all repos — grayfriday @ fecfec2059f4488cbe431b57be0bdca6b3c63e9b

blackfriday fork with a few changes

Implement SkipImages and add test
Vytautas Ĺ altenis vytas@rtfb.lt
Tue, 05 Apr 2016 11:12:30 +0300
commit

fecfec2059f4488cbe431b57be0bdca6b3c63e9b

parent

9da90c5929930e100e0e36619d52e1afa0d6f7bd

2 files changed, 12 insertions(+), 0 deletions(-)

jump to
M html.gohtml.go

@@ -1170,6 +1170,9 @@ r.out(w, tag("/a", nil, false))

} } case Image: + if r.flags&SkipImages != 0 { + return SkipChildren + } if entering { dest := node.LinkData.Destination dest = r.addAbsPrefix(dest)
M inline_test.goinline_test.go

@@ -1130,6 +1130,15 @@ HTMLFlags: SkipLinks,

}) } +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{ "---",