all repos — grayfriday @ 386ef80f18233ea97960e855a54382ec446c6637

blackfriday fork with a few changes

Merge pull request #175 from vbatoufflet/deflist-fix

Fix definition lists end-of-list detection
Vytautas Ĺ altenis vytas@rtfb.lt
Mon, 08 Jun 2015 11:33:30 +0300
commit

386ef80f18233ea97960e855a54382ec446c6637

parent

706b1e01beaf991544e2c7d5e1a019b7f18d0ed1

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

jump to
M block.goblock.go

@@ -1186,7 +1186,10 @@ next := i

for data[next] != '\n' { next++ } - if next < len(data)-2 && data[next+1] != ':' { + for next < len(data)-1 && data[next] == '\n' { + next++ + } + if i < len(data)-1 && data[i] != ':' && data[next] != ':' { *flags |= LIST_ITEM_END_OF_LIST } } else {
M block_test.goblock_test.go

@@ -820,6 +820,16 @@ "<dt>Term 2</dt>\n" +

"<dd>Definition b</dd>\n" + "</dl>\n", + "Term 1\n: Definition a\n\nTerm 2\n: Definition b\n\nTerm 3\n: Definition c\n", + "<dl>\n" + + "<dt>Term 1</dt>\n" + + "<dd>Definition a</dd>\n" + + "<dt>Term 2</dt>\n" + + "<dd>Definition b</dd>\n" + + "<dt>Term 3</dt>\n" + + "<dd>Definition c</dd>\n" + + "</dl>\n", + "Term 1\n: Definition a\n: Definition b\n\nTerm 2\n: Definition c\n", "<dl>\n" + "<dt>Term 1</dt>\n" +

@@ -877,6 +887,18 @@ "<dt>Term 2</dt>\n" +

"<dd><p>Definition b</p></dd>\n" + "</dl>\n" + "\n<p>Text 1</p>\n", + + "Term 1\n\n: Definition a\n\nText 1\n\nTerm 2\n\n: Definition b\n\nText 2", + "<dl>\n" + + "<dt>Term 1</dt>\n" + + "<dd><p>Definition a</p></dd>\n" + + "</dl>\n" + + "\n<p>Text 1</p>\n" + + "\n<dl>\n" + + "<dt>Term 2</dt>\n" + + "<dd><p>Definition b</p></dd>\n" + + "</dl>\n" + + "\n<p>Text 2</p>\n", } doTestsBlock(t, tests, EXTENSION_DEFINITION_LISTS) }