gfw.common.diff.diff_lines#

diff_lines(a, b)[source]#

Generate a line-by-line diff of two strings with rich markup.

Parameters:
  • a (str) – First multi-line string to compare.

  • b (str) – Second multi-line string to compare.

Returns:

  • a_diff: The first string annotated with diff highlights.

  • b_diff: The second string annotated with diff highlights.

  • changed: True if any differences were found, False otherwise.

Return type:

A tuple of (a_diff, b_diff, changed) where