PageRenderTime 22ms CodeModel.GetById 16ms app.highlight 3ms RepoModel.GetById 1ms app.codeStats 0ms

/test/bugs/unfixed/blanks-around-nested-blocks-2.t2t

http://txt2tags.googlecode.com/
Unknown | 37 lines | 21 code | 16 blank | 0 comment | 0 complexity | 10f48068c4549c691f531765c4ec3ff1 MD5 | raw file
 1
 2%!target: html
 3%!options: -H -o-
 4
 5%%%
 6Sample output:
 7	<BLOCKQUOTE>
 8
 9	<HR NOSHADE SIZE=1>
10
11
12	<HR NOSHADE SIZE=1>
13
14	</BLOCKQUOTE>
15
16On the output, there are *two* blank lines between the bars, and it should be only one. The extra line is added because both bars have their own blank lines before and after (respecting blanksaroundbar rule).
17
18It's _should_add_blank_line() mission to detect this situation and avoid printing the opening blank for the second bar, since the first bar already printed one on closing.
19
20It fails because the bar are nested, in this case, inside a quote block. 
21
22_should_add_blank_line() doesn't play well with nested blocks. It 
23
24_should_add_blank_line() does not handle nested blocks very well. It asks BLOCK.last content to decide if the opening blank line should be added, but it fails because BLOCK.last is empty. It should be "bar", but BLOCK.last only registers blocks closed at root level (BLOCK.level=1). As these are bars nested inside a quote block (level=2), BLOCK.last is empty until the quote block is closed (which occurs after the two bars are already put on target).
25
26The solution: it must see if we're dealing with a nested block, and if so, check if we're the first block or which was the last closed block at the same neste level.
27
28This bug affects:
29test/crossing/bar.t2t
30test/crossing/bar2.t2t
31
322010-06-17
33%%%
34
35	----------------------------------------------
36	----------------------------------------------
37