ropensci / emld

:package: JSON-LD representation of EML
https://docs.ropensci.org/emld
Other
13 stars 6 forks source link

Fix a bug where TextType content got newlines it shouldn't have #37

Closed amoeba closed 5 years ago

amoeba commented 5 years ago

@jeanetteclark and others found this while adding subscripts to an EML document. What happens is that as_jsonlist is reading in the contents of TextType para and section elements, and converting them to literal XML strings with this code.

<para>H<subscript>2</subscript>O</para> gets turned into

para
  H
  <subscript>2</subscript>
  O

and calling as.character on the above followed by a paste with collapse = "\n" introduces newlines between each child of the para. This isn't a huge issue for most uses cases but, when rendering to HTML via XSLT, you end up with spaces between the H and the 2 because browsers are getting the the newline and converting it to whitespace.

Fixes https://github.com/ropensci/EML/issues/282

amoeba commented 5 years ago

(Failed Travis build looks to be related to the recent switch from the opencpu/jq PPA to jeroen/jq so: unrelated to my PR I think). All tests pass and devtools::check() comes back clean.

cboettig commented 5 years ago

Sweet! Thanks for catching this. Want to patch travis in the same PR? (Am away from office and just with phone atm)

On Fri, Jul 19, 2019 at 6:24 PM Bryce Mecum notifications@github.com wrote:

(Failed Travis build looks to be related to the recent switch from the opencpu/jq PPA to jeroen/jq so: unrelated to my PR I think). All tests pass and devtools::check() comes back clean.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ropensci/emld/pull/37?email_source=notifications&email_token=AABWK6TKGOOYWCGOMW2M57LQAJLNFA5CNFSM4IFNB2XKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2NCF6Q#issuecomment-513417978, or mute the thread https://github.com/notifications/unsubscribe-auth/AABWK6RU67EI4TJINAJP3MLQAJLNFANCNFSM4IFNB2XA .

--

Carl Boettiger http://carlboettiger.info/

amoeba commented 5 years ago

Okay, done!