all repos — grayfriday @ ca82b8db3a85c5da858a1ec7c344872626ea2e81

blackfriday fork with a few changes

panic fix (issue #33) with test case
Russ Ross russ@dixie.edu
Wed, 11 Sep 2013 12:47:43 -0600
commit

ca82b8db3a85c5da858a1ec7c344872626ea2e81

parent

472fe3a75661156c826b7b148cd4c0c0e28f84a9

2 files changed, 4 insertions(+), 1 deletions(-)

jump to
M inline.goinline.go

@@ -181,7 +181,7 @@

// '[': parse a link or an image or a footnote func link(p *parser, out *bytes.Buffer, data []byte, offset int) int { // no links allowed inside regular links, footnote, and deferred footnotes - if p.insideLink && (data[offset-1] == '[' || data[offset+1] == '^') { + if p.insideLink && (offset > 0 && data[offset-1] == '[' || len(data)-1 > offset && data[offset+1] == '^') { return 0 }
M inline_test.goinline_test.go

@@ -410,6 +410,9 @@ "<p><a href=\"/url/\">link &amp; ampersand</a></p>\n",

"[link](/url/&query)\n", "<p><a href=\"/url/&amp;query\">link</a></p>\n", + + "[[t]](/t)\n", + "<p><a href=\"/t\">[t]</a></p>\n", } doTestsInline(t, tests) }