sergi / go-diff

Diff, match and patch text in Go
MIT License
1.81k stars 207 forks source link

Inconsistent results when the patches have special characters #97

Closed nihlaakram closed 3 years ago

nihlaakram commented 5 years ago

When the patches have special characters such as %, > and < , inconsistent patch status is returned by PatchApply()

ernierasta commented 5 years ago

Hi, I know almost nothing about this library, but from what I had tested, those symbols will not occur in patch if You use DiffMain and then PatchMake functions. they will be converted to: %25, %3E and %3C in patch string.

If you are creating patch in some different way maybe consider converting those chars to given values.