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

A .rtf reader in the web UI. #1294

Open
kylak opened this issue Jan 3, 2020 · 2 comments
Open

A .rtf reader in the web UI. #1294

kylak opened this issue Jan 3, 2020 · 2 comments

Comments

@kylak
Copy link

kylak commented Jan 3, 2020

Hello all,

Here is the situation where I am :

I'm looking to keep in Perkeep a note with words in bold, underlined words, italics words, etc… (so the note is not a .txt file but a .rtf file).

So after I uploaded this note on Perkeep, I find out that the web UI couldn't display it as "Document" like the web UI can for txt or pdf format file.

So I tried to convert the rtf note to the html format hopping that maybe the web UI would display it, but the same, he didn't.

So, I was wondering if there is a file format for formatted text (like .rtf, .html, .md, etc…) that the web UI could display as "Document" (in sort that we don't need each time to do a right click and then click to "View original" and then we are out of the webUI) like he does for .txt file ?
If there's not, I was wondering if it could be possible to add a .rtf reader (as there is for pdf files) to the web UI ?

Maybe, to display the rtf file, the webUI could convert the .rtf file to the html format and then display the html page as "Document" ? To display the html page, the webUI could maybe let the web navigator doing that.
Or maybe that there's others simpler solutions.

Thanks,

Gustav.

@zenhack
Copy link
Contributor

zenhack commented Jan 3, 2020

Unfortunately it's just txt and pdf right now. The 'document' display's implementation just sticks the content in an iframe, so it can only handle content types that the browser already understands, and html isn't on our whitelist right now because accepting arbitrary html is possibly problematic from a security perspective.

I'd love to see support for other formats. We could do HTML if we add a sanitization pass first, or maybe by sandboxing the iframe (maybe through a mix of iframe sandboxing options and content-security-policy).

Formats not directly supported by the browser (like rtf), would need to be handled specially, but there's got to be a js lib out there we can use to just do the conversion in the browser.

@kylak
Copy link
Author

kylak commented Jan 5, 2020

Thanks for your answer !

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

No branches or pull requests

2 participants