From 0a65037e120e0e14659991379648a1a4345b6981 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 7 Feb 2013 10:34:50 -0500 Subject: Preserve whitespace in empty lines Partial fix for #183. By preserving tabs at the start of empty lines in code blocks, the parser will retain those empty lines. Still does not work consistantly if the tab is missing!? Not sure why. Also added tests. --- tests/misc/blank_lines_in_codeblocks.txt | 37 ++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 tests/misc/blank_lines_in_codeblocks.txt (limited to 'tests/misc/blank_lines_in_codeblocks.txt') diff --git a/tests/misc/blank_lines_in_codeblocks.txt b/tests/misc/blank_lines_in_codeblocks.txt new file mode 100644 index 0000000..f2e582a --- /dev/null +++ b/tests/misc/blank_lines_in_codeblocks.txt @@ -0,0 +1,37 @@ +Preserve blank lines in code blocks + + a code block + + two blank lines + + + three blank lines + + + + four blank lines + + + + + five blank lines + + + + + + six blank lines + + + + + + + End of block + + + + + + +End of document \ No newline at end of file -- cgit v1.2.3 From 25e187598f06f04feeacbf967b7651e93286d3f4 Mon Sep 17 00:00:00 2001 From: Waylan Limberg Date: Thu, 7 Feb 2013 11:43:46 -0500 Subject: HtmlBlockProcessor preserves empty lines Partial fix for #183. This has the same effect on empty lines in code blocks as not using the html processor at all (which was eating some of the missing newlines as reported in issue #183). By doing `rsplit('\n\n')` the third newline (in each set of three) always ends up at the end of a block, rather than the begining - which it less of an issue for the html processor. Also updated tests to indicate final intended output, although they do not fully pass yet. --- tests/misc/blank_lines_in_codeblocks.txt | 50 +++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 7 deletions(-) (limited to 'tests/misc/blank_lines_in_codeblocks.txt') diff --git a/tests/misc/blank_lines_in_codeblocks.txt b/tests/misc/blank_lines_in_codeblocks.txt index f2e582a..e7ae102 100644 --- a/tests/misc/blank_lines_in_codeblocks.txt +++ b/tests/misc/blank_lines_in_codeblocks.txt @@ -1,37 +1,73 @@ -Preserve blank lines in code blocks +Preserve blank lines in code blocks with tabs: a code block - two blank lines + two tabbed lines - three blank lines + three tabbed lines - four blank lines + four tabbed lines - five blank lines + five tabbed lines - six blank lines + six tabbed lines - End of block + End of tabbed block +And without tabs: + + a code block + + two blank lines + + + three blank lines + + + + four blank lines + + + + + five blank lines + + + + + + six blank lines + + + + + + + End of block + + + + + + End of document \ No newline at end of file -- cgit v1.2.3