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

htmldiff: Preserve whitespace after a tag #125

Closed
wants to merge 8 commits into
base: master
from

Conversation

Projects
None yet
2 participants
@orf
Contributor

orf commented Aug 1, 2013

Whitespace after a tag (but before the first bit of non-whitespace text) is currently lost while diffing. These changes modify the start_tag function to keep any whitespace that occurs after it. I also re-named split_trailing_whitespace to split_whitespace and made it return both the start and end whitespace of a string as a tuple.

As part of this token.trailing_whitespace is now re-named to token.whitespace and is a tuple containing the start and end whitespace, although at the moment the start whitespace is always an empty string.

@scoder

This comment has been minimized.

Show comment
Hide comment
@scoder

scoder Aug 1, 2013

Since you're already stripping the word above anyways, it should be possible to avoid the first slicing here.

scoder commented on src/lxml/html/diff.py in d9186f6 Aug 1, 2013

Since you're already stripping the word above anyways, it should be possible to avoid the first slicing here.

This comment has been minimized.

Show comment
Hide comment
@orf

orf Aug 1, 2013

Owner

Done

Owner

orf replied Aug 1, 2013

Done

@orf

This comment has been minimized.

Show comment
Hide comment
@orf

orf Sep 2, 2013

Contributor

I've updated the request to stop the test from failing, and its all green on Travis. Is there anything else you would like me to include in this request, or is this enough?

Contributor

orf commented Sep 2, 2013

I've updated the request to stop the test from failing, and its all green on Travis. Is there anything else you would like me to include in this request, or is this enough?

@orf orf closed this Jan 9, 2014

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