/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. %!target: txt
  2. %!options: -H -o-
  3. %%%
  4. See also: issue 31 http://code.google.com/p/txt2tags/issues/detail?id=31
  5. In 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:
  6. | one | two |
  7. | um | dois |
  8. Macros 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
  9. | one | two | %%date |
  10. Will turn to
  11. | one | two | 20001231 |
  12. on the txt target.
  13. But this is not desired when the table comes from a CSV file, using the %!csv command. Macros and formatting should NEVER be expanded.
  14. For 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
  15. one,two,%%date
  16. inside a CSV file, gives
  17. | one | two | 20001231 |
  18. as output on txt target. The error is that the %%date macro should not be expanded.
  19. This is tricky to fix, since at this point we're inside an exception inside the exception: csv -> table -> verbatim mapping.
  20. For now, I'm just removing the %%date macro from the txt output.
  21. This bug affects:
  22. test/csv/marked.t2t
  23. 2010-08-04
  24. %%%