sean1996 / google-diff-match-patch

Automatically exported from code.google.com/p/google-diff-match-patch
Apache License 2.0
0 stars 0 forks source link

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

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
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

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Fixed with patch from issue 97

Original comment by calistop...@gmail.com on 23 Jan 2014 at 6:02