HSDiff.Patch (hunt_szymanski_diff v0.1.0)

Applies a diff ([eq:, del:, ins:]) to an old text, producing the new text.

If the old text is a string, we return a string (with lines joined by " "). If the old text is a list of lines, we return a list of lines.

Summary

Functions

Patches the old_text with the given diff.

Functions

patch(old_text, diff)

Patches the old_text with the given diff.

  • If old_text is a string, returns a string.
  • If old_text is a list of lines, returns a list of lines.