all repos — grayfriday @ f7510976a3f369231c646fa6bd7e6018b3b1bba8

blackfriday fork with a few changes

Fix escaping asterisks within emphasis

First check for escaped character, *then* look if i-th character is an
emphasis character.

Closes #18.
Vytautas Ĺ altenis vytas@rtfb.lt
Tue, 13 Oct 2015 19:57:07 +0300
commit

f7510976a3f369231c646fa6bd7e6018b3b1bba8

parent

8cec3a854e68dba10faabbe31c089abf4a3e57a6

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

jump to
M inline.goinline.go

@@ -919,14 +919,13 @@ }

if i >= len(data) { return 0 } - if data[i] == c { - return i - } - // do not count escaped chars if i != 0 && data[i-1] == '\\' { i++ continue + } + if data[i] == c { + return i } if data[i] == '`' {
M inline_test.goinline_test.go

@@ -153,6 +153,9 @@ "<p>odd <em>number\nof</em> markers_ here</p>\n",

"mix of *markers_\n", "<p>mix of *markers_</p>\n", + + "*What is A\\* algorithm?*\n", + "<p><em>What is A* algorithm?</em></p>\n", } doTestsInline(t, tests) }