Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

exported Notes lose formatting #13

Open
bshannon opened this issue Dec 12, 2018 · 12 comments
Open

exported Notes lose formatting #13

bshannon opened this issue Dec 12, 2018 · 12 comments

Comments

@bshannon
Copy link

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.

@ydkhatri
Copy link
Owner

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.

@bshannon
Copy link
Author

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.

@sweenzor
Copy link

Having the formatting data would be super useful to me. 👍

@bshannon
Copy link
Author

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.

@ydkhatri
Copy link
Owner

Please share your findings, either publicly or privately.

@sweenzor
Copy link

@bshannon please do share! happy to help build on what you've got 👍

@bshannon
Copy link
Author

I've created a first cut at documenting the format here.
Java source code coming soon...

Let me know of any questions.

@sweenzor
Copy link

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

@bshannon
Copy link
Author

bshannon commented Jan 27, 2019

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.

@sweenzor
Copy link

sweenzor commented Apr 7, 2019

Hoping that you've had a breakthrough since January! 😄

@bshannon
Copy link
Author

Try my savenotes program.

@sweenzor
Copy link

I will. Thank you @bshannon!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants