It seems that GitHub avoids the blank line issue when copying code from diffs by using a table to display them.
I ended up using divs back in #29 because our tables have global styles that need to be manually removed. This isn't ideal because the global table styles can change, and we would need to update the diff styles whenever this happens.
We can try using the display: table-* property to still render the diff as a table but using div tags, avoiding the global styles.
It seems that GitHub avoids the blank line issue when copying code from diffs by using a table to display them.
I ended up using divs back in #29 because our tables have global styles that need to be manually removed. This isn't ideal because the global table styles can change, and we would need to update the diff styles whenever this happens.
We can try using the
display: table-*
property to still render the diff as a table but using div tags, avoiding the global styles.