Skip to content

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

Open
andreip wants to merge 2 commits into
closeio:masterfrom
andreip:master
Open

Don't include html_top in a no-message forward#16
andreip wants to merge 2 commits into
closeio:masterfrom
andreip:master

Conversation

@andreip

@andreip andreip commented Dec 31, 2016

Copy link
Copy Markdown

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

andreip commented Feb 13, 2017

Copy link
Copy Markdown
Author

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

@andreip

andreip commented Nov 22, 2017

Copy link
Copy Markdown
Author

bump

@thomasst

thomasst commented Jun 7, 2018

Copy link
Copy Markdown
Member

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

andreip commented Jul 5, 2018

Copy link
Copy Markdown
Author

@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.

2 participants