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

Don't include html_top in a no-message forward #16

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

andreip
Copy link

@andreip andreip commented Dec 31, 2016

Addresses #14

I'm not sure if I fixed the root cause of it, did my best to understand what's happening here.

The top_range in unwrap_html would be an interval like (0, 1) and the trim_slice would make it (1, 1) which I think is wrong to pass it along to slice_tree after.

Since slice_tree now receives a wrong interval since start_refs[1] appears after end_refs[1] so it's quite unusual situation. To be precise, in slice_tree:

>>> et.getelementpath(start_ref[0])
body/div/div/div
>>> et.getelementpath(end_ref[0])
'body/div/div/br[1]'

and by checking the HTML of the test HTMLUnwrapTestCase.test_gmail_forward_no_message you can see what I'm referring to that end appears before the start.

@andreip
Copy link
Author

andreip commented Feb 13, 2017

this PR has 2 line changes + the rest are 2 tests, should be pretty easy to follow.

@andreip
Copy link
Author

andreip commented Nov 22, 2017

bump

@thomasst
Copy link
Member

thomasst commented Jun 7, 2018

Thanks for finding this! I believe this should also be handled in in slice_tree (it's similar to https://github.com/andreip/quotequail/blob/7d0cf6a7e2def22a37b65414d3f2d3a7f9cfc410/quotequail/_html.py#L161)

@andreip
Copy link
Author

andreip commented Jul 5, 2018

@thomasst you're right, that did fit in slice_tree function better. See updated PR.

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.

None yet

2 participants