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

Quote html parts #626

Merged
merged 7 commits into from
May 5, 2019
Merged

Quote html parts #626

merged 7 commits into from
May 5, 2019

Conversation

gauteh
Copy link
Member

@gauteh gauteh commented Apr 3, 2019

Update mail.reply.quote_processor to whatever you want to process HTML parts into text when quoting.

#319 and others.

@mxmehl
Copy link
Contributor

mxmehl commented Apr 3, 2019

Thanks! I tried it and it failed for 3 HTML only mails I tested :(

Nothing happens in the UI after pressing r, but in the logfile there is quite some activity.

Logfile

@gauteh
Copy link
Member Author

gauteh commented Apr 3, 2019 via email

@gauteh
Copy link
Member Author

gauteh commented Apr 3, 2019

Please try the latest version again, moved to w3m which seems to be a little bit more robust. But maybe not as nice output.

@jimcheetham
Copy link

This is working for me (once I realised that my startup options were being invisibly ignored because there was an existing astroid session running in a different desktop).

Also, because you're execve() the call, I can successfully invoke an arbitrary pipeline by taking responsibility for using "bash -c 'cmd | cmd'" if I want to.

I would love to be able to use something like this on message preview, instead of having to explicitly invoke my preview option ...

@gauteh
Copy link
Member Author

gauteh commented Apr 4, 2019

Great! What do you mean with preview and preview option?

@jimcheetham
Copy link

As per my original #319; but where I originally said that "Not having them render HTML by default seems sensible" I'm sort of less comfortable with that over time. Possibly not the right conversation to have on a patch that addresses the reply function though.

@gauteh
Copy link
Member Author

gauteh commented Apr 4, 2019

You can choose to have the HTML part to be shown by default, think it is thread_view.preferred_type or thread_view.preferred_html_only (the latter opens html parts of HTML only part, otherwise uses the text part). Just to make sure, you do know you can activate/press enter on the html part to open it?

@gauteh
Copy link
Member Author

gauteh commented Apr 4, 2019

Something that would be nice would be to also include attachments (like images) and have the CID be updated accordingly (e.g. #597). But might not be any point without converting to markdown.

@jimcheetham
Copy link

Thanks, I'll check later. Yes, I can currently read messages that have no text/plain portion by selecting the text/html part, and pressing enter, but I hadn't looked for a 'display by default' option recently, so I'll double-check.

@gauteh
Copy link
Member Author

gauteh commented Apr 6, 2019

@mxmehl: did you have a chance to try again?

@mxmehl
Copy link
Contributor

mxmehl commented Apr 7, 2019

Yes, I tried it today and it works! w3m made the difference, lynx dump only worked with very simple (and valid) HTML, for HTML-only newsletters which tend to contain a lot of inline CSS and invalid HTML, it seems to be unstable.

@gauteh
Copy link
Member Author

gauteh commented Apr 7, 2019

Nice, what error did you get with lynx -dump -stdin?

@mxmehl
Copy link
Contributor

mxmehl commented Apr 8, 2019

Nice, what error did you get with lynx -dump -stdin?

None. Nothing happened in the UI, and the log looked the same as in my first comment. It only worked for simple (valid?) HTML. I can forward you one of the failing emails if you want

@gauteh
Copy link
Member Author

gauteh commented Apr 9, 2019

Ok, I think I have one message in the test suite where I get the same error. Looks like a conversion error when lynx fails.. either way we should handle whatever output the processor throws at us.

@gauteh gauteh merged commit aae4c52 into astroidmail:master May 5, 2019
@gauteh
Copy link
Member Author

gauteh commented May 5, 2019

Merged. Not working for lynx, but seems to work well with w3m. Ideally need to fix conversion error at later time.

@l1gi
Copy link
Contributor

l1gi commented Aug 14, 2019

I have hit probably the same issue.

Log file: https://cloud.tekkirk.org/index.php/s/dJHM6NbLZtc597T

[17:33:15] [0x00000008099b5000] [M] [error] astroid needs an UTF-8 locale! this is probably not going to work.
...
[17:33:23] [0x00000008099b5000] [M] [info] cmd: running: w3m -dump -T text/html
[17:33:23] [0x00000008099b5000] [M] [debug] em: deconstruct.
[17:33:23] [0x00000008099b5000] [M] [info] db: closing db.
[17:33:23] [0x00000008099b5000] [M] [debug] db: ro: waiting for lock to close..
[17:33:23] [0x00000008099b5000] [M] [debug] db: ro: closing..
[17:33:23] [0x00000008099b5000] [M] [debug] mt: destruct.
[17:33:23] [0x00000008099b5000] [M] [debug] ms: deconstruct
[17:33:23] [0x00000008099b5000] [M] [debug] chunk: deconstruct.

(:44954): glibmm-CRITICAL **: 17:33:23.538:
unhandled exception (type Glib::Error) in signal handler:
domain: g_convert_error
code : 1
what : Invalid byte sequence in conversion input

Mail: https://cloud.tekkirk.org/index.php/s/n5oSGPi2PfwjYzY

I am at:

commit 3813a51 (HEAD -> master, origin/master, origin/HEAD)
Author: Gaute Hope [email protected]
Date: Sun Aug 11 19:42:31 2019 +0200

test: #585 markdown clipped with unicode multi-byte chars

@gauteh
Copy link
Member Author

gauteh commented Aug 15, 2019 via email

@l1gi
Copy link
Contributor

l1gi commented Aug 15, 2019

Yes, that was the reason why I pasted it. My previous locale setting:

LANG=
LC_CTYPE="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_ALL=en_US.UTF-8

After I have set LANG also to en_US.UTF-8 it started to work. I thought my setting is valid, so maybe it is not.

Thanks much for your time.

@gauteh
Copy link
Member Author

gauteh commented Aug 15, 2019 via email

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

Successfully merging this pull request may close these issues.

4 participants