rtfpessoa / diff2html

Pretty diff to html javascript library (diff2html)
https://diff2html.xyz
MIT License
2.79k stars 272 forks source link

Vertical align mismatch between inserted/deleted text and matching #487

Closed brandondong closed 1 year ago

brandondong commented 1 year ago

Step 0: Describe your environment

Step 1: Describe the problem:

Inserted/deleted text sinks slightly below matching text. Notice in this screenshot of the demo page how the parenthesis don't line up exactly: image

Steps to reproduce:

  1. Navigate to the demo page and zoom into the scripts/hulk.js example.

Expected Results:

Relevant Code:

If https://github.com/rtfpessoa/diff2html/blob/2c7e03d2660c0597eb15cc9db9ef652f57a1e224/src/ui/css/diff2html.css#L159 (and ins) is changed to vertical-align: baseline; or just removed, then this should work as expected. Not exactly sure why the middle alignment was added in the first place. I can see it was added in https://github.com/rtfpessoa/diff2html/pull/348.