curran / curran/google-diff-match-patch

NewLines appear broken in patches (Python 3, Django 1.6.1)

Open
#95 0 comments 0 reactions 0 assignees View on GitHub
auto-migrated Priority-Medium Type-Defect
Dominant language
Python
Stars
17
Forks
2
PR merge metrics
No merged PRs in 30d

Description

```
What steps will reproduce the problem?
1. have a change at the end of a line
- from:
some text
more text
- to:
some text with change
more text
2. call
d = dmp.diff_match_patch()
diffs = d.diff_main(text1, text2)
patch = d.patch_make(diffs)
print_me = d.patch_toText(patch)

What is the expected output? What do you see instead?
print_me containts:
+ with change
%0D%0Amore text

it should have contained:
+ with change
more text

What version of the product are you using? On what operating system?
- Python 3.3 x64 on Windows
- Django 1.6.1
- Chrome on Windows

Please provide any additional information below.

I could do a work-around by removing newlines but I have no idea what side
effects I'm introducing:

diffs = d.diff_main(
"".join(text1.splitlines()),
"".join(text2.splitlines())
)
```

Original issue reported on code.google.com by `calistop...@gmail.com` on 22 Jan 2014 at 9:56

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.