Rapporter / pander

An R Pandoc Writer: Convert arbitrary R objects into markdown
http://rapporter.github.io/pander/
Open Software License 3.0
294 stars 66 forks source link

Error if list element is of class 'Date' (bug?) #328

Closed tdeenes closed 5 years ago

tdeenes commented 5 years ago

Maybe I am missing something obvious, but this code results in an error (version 0.6.2):

pander(list(x = as.Date("2018-11-05")))

The problem is caused by pander:::pander.Date which passes all dots arguments to pander:::pandoc.date which passes the args further to pander:::pandoc.date.return which does not have ... in its arguments. Note that pander.list contains this line:

res.i <- paste(capture.output(pander(x[[i]], indent = indent + 1)), collapse = "\n")

, and because of the above, the argument indent is passed to pander:::pandoc.date.return, which of course fails to process it.

daroczig commented 5 years ago

Oh, good catch, and thanks for the detailed report.