Skip to content

Suggested edit diffs show the entire post as changed #2122

Description

@trichoplax

Describe the bug
When a suggested edit is made, its diff shows every paragraph highlighted in red on the left and green on the right, as if every paragraph had been changed. If the suggested edit is approved, the same problem shows in the post history. Edits made directly (not involving a suggested edit) still show correct diffs, with only changed paragraphs having highlighting.

To Reproduce
Steps to reproduce the behavior:

  1. Suggest an edit.
  2. Go to the Edits page and choose your suggested edit.
  3. See a broken diff.
  4. Have the suggested edit approved.
  5. Go to the post history.
  6. See the same broken diff.

Expected behavior
Only changed paragraphs should have highlighting.

Screenshots

Post history showing the difference between an edit diff (correct highlighting) and a suggest edit diff (all paragraphs highlighted)

Additional context
This may be related to #2119 normalising newlines. Is this creating a difference between before and after for every newline in the post, but only for suggested edits and not direct edits?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions