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

splitLine function not working when string doesn't contain any spaces. #363

Closed madeinoz67 closed 1 year ago

madeinoz67 commented 1 year ago

I found when trying to split a table where a column contains some long string that it fails to split, digging deeper it looks like the splitLine Function is not working when the string doesn't contain any spaces.

splitLine("web/modules/contrib/webform/modules/webform_submission_export_import/src/WebformSubmissionExportImportImporter.phpt",6)
[1] "web/modules/contrib/webform/modules/webform_submission_export_import/src/WebformSubmissionExportImportImporter.phpt"
daroczig commented 1 year ago

That's intended, as splitting words is not supported by default. If you really want to split words, try to use hyphenation:

r$> cat(splitLine("web/modules/contrib/webform/modules/webform_submission_export_import/src/WebformSubmissionExportImportImporter.phpt", 
+ max.width = 20, use.hyphening = TRUE))

web/modules/contr-
ib/webform/module-
s/webform_submissio-
n_export_import/s-
rc/WebformSubmissi-
onExportImpo-
rtImporter.phpt