I do not know the ACTUAL specification of the Mozilla Firefox's JSON bookmarks archive format (I looked up for it but couldn't find it).
I am not sure if I am doing the right thing when using write instead of display to print strings, but it does take care of linebreaks.
So if you have any comments and/or improvements in mind, please write a message on the issue tracker or on the Balkanised Activitypub Federation to @mu@posting.solutions. I haven't left the house in days and am very lonely. Thank you!