PageRenderTime 4ms CodeModel.GetById 2ms app.highlight 0ms RepoModel.GetById 1ms app.codeStats 0ms

/test/bugs/unfixed/macro-inside-verb-as-table-for-csv.t2t

http://txt2tags.googlecode.com/
Unknown | 43 lines | 24 code | 19 blank | 0 comment | 0 complexity | d6b706b3319eca9c1ea33d5d9431fb11 MD5 | raw file
 1
 2%!target: txt
 3%!options: -H -o-
 4
 5%%%
 6See also: issue 31 http://code.google.com/p/txt2tags/issues/detail?id=31
 7
 8In targets that do not support tables (ie.: txt), txt2tags embed the full marked table inside a verbatim block, so it can still look pretty at output:
 9
10  | one | two  |
11  | um  | dois |
12
13Macros and other formatting are not allowed inside verbatim, but in this case the original mark was for a table, where user expect marks to be expanded. So macros and formatting is expanded on this table -> verbatim mapping. So
14
15  | one | two | %%date |
16
17Will turn to 
18
19  | one | two | 20001231 |
20
21on the txt target.
22
23But this is not desired when the table comes from a CSV file, using the %!csv command. Macros and formatting should NEVER be expanded.
24
25For table aware targets it's working ok (see test/csv/marked.t2t). But the table -> verbatim mapping is expanding the macros on txt target. So
26
27  one,two,%%date
28
29inside a CSV file, gives
30
31  | one | two | 20001231 |
32
33as output on txt target. The error is that the %%date macro should not be expanded.
34
35This is tricky to fix, since at this point we're inside an exception inside the exception: csv -> table -> verbatim mapping.
36
37For now, I'm just removing the %%date macro from the txt output.
38
39This bug affects:
40test/csv/marked.t2t
41
422010-08-04
43%%%