Found in the XML representation of an edge case R file:
library(xml2)
library(xmlparsedata)
p = parse("https://raw.githubusercontent.com/mwaldstein/edgarWebR/fb9a38e6a57186ffd1c93cc1aa00c4fdf1bc5514/tests/cache/browse-edgar-11457c.R")
xml = read_xml(xml_parse_data(p))
Found in the XML representation of an edge case R file:
Printing this is painfully slow:
Took a brief look, it looks like
encodeString()
is the culprit:Is it possible to apply
substr()
twice -- once afteras.character()
, then again afterencodeString()
?This is clearly already wayyy to wide (
width = 180
for me).I believe we can always just apply
since the default behavior of
encodeString()
is to simply add\
to non-printable characters, so it will just be a weakly wider version of the input.Happy to file a PR if that sounds good.