russross/blackfriday — pull request #60 by shurcooL (2014-04-12 03:03:27+00:00)
Title: Add failing test for an issue introduced by PR #56.

The issue is that when there are more than 1 fenced code blocks with a blank line before and after, the parser introduces a single extra new line to all the fenced code blocks except the last one.

Here's the failing test case:

Bla bla

``` oz
code blocks breakup paragraphs
```

Bla Bla

``` oz
multiple code blocks work okay
```

Bla Bla

The following is both the expected output, and the actual output generated with blackfriday before PR #56 was merged:

Bla bla

```oz
code blocks breakup paragraphs
```

Bla Bla

```oz
multiple code blocks work okay
```

Bla Bla

This is the current actual output:

Bla bla

```oz
code blocks breakup paragraphs

```

Bla Bla

```oz
multiple code blocks work okay
```

Bla Bla

Note that the all fenced code blocks, other than the last one, have an extra newline appended.

This PR currently only adds a failing test case. I'm working on a fix (help is welcome if you can fix it faster).

For reference, this is the test output:

```
blackfriday $ go test --short .
--- FAIL: TestFencedCodeBlock (0.00 seconds)
block_test.go:45:
Input ["Bla bla\n\n``` oz\ncode blocks breakup paragraphs\n```\n\nBla Bla\n\n``` oz\nmultiple code blocks work okay\n```\n\nBla Bla\n"]
Expected["

Bla bla

\n\n

code blocks breakup paragraphs\n

\n\n

Bla Bla

\n\n

multiple code blocks work okay\n

\n\n

Bla Bla

\n"]
Actual ["

Bla bla

\n\n

code blocks breakup paragraphs\n\n

\n\n

Bla Bla

\n\n

multiple code blocks work okay\n

\n\n

Bla Bla

\n"]
FAIL
FAIL	github.com/russross/blackfriday	0.041s
```