mac_apt
mac_apt copied to clipboard
exported Notes lose formatting
Exported notes contain only the plain text content of the notes, losing any rich text formatting. The formatting information seems to be stored separately from the text that it applies to. It's not obviously in html or rtf or any other common rich text format. It would be great if this formatting information could be extracted and applied to the text, creating an html or markdown or similar rich text document. The Exporter app is able to create a markdown version of the text.
On older versions of the notes app, the database contains html, which if available is provided by the notes plugin. However, newer versions have an unknown format where the data and formatting are stored separately. I have described the basic format here.
Their version of the markup is yet unknown as well as a low priority item for research right now.
I'm guessing it's an NSAttributedString, but I don't know enough about Objective-C and especially its serialization format to know how to interpret the data.
Having the formatting data would be super useful to me. 👍
It's all there, if you can figure out how to make sense of it. I've been working on it, and have made some progress, but there's still a lot of guesswork involved.
Please share your findings, either publicly or privately.
@bshannon please do share! happy to help build on what you've got 👍
I've created a first cut at documenting the format here. Java source code coming soon...
Let me know of any questions.
Fantastic! Thanks for sharing.
Is it possible that the previous HTML formatting is just being loaded into an NSAttributedString?
See the "Loading an attributed string from HTML" section of this article: https://www.hackingwithswift.com/articles/113/nsattributedstring-by-example
It's being "loaded" in the sense that it reads and parses the html and converts it into the closest equivalent NSAttributedString attributes. The original html tags are lost.
Hoping that you've had a breakthrough since January! 😄
Try my savenotes program.
I will. Thank you @bshannon!