Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

trailing newline eats last line in HTML diff #84

Open
ninewise opened this issue May 3, 2017 · 0 comments
Open

trailing newline eats last line in HTML diff #84

ninewise opened this issue May 3, 2017 · 0 comments

Comments

@ninewise
Copy link

ninewise commented May 3, 2017

When the only difference between two string is a final newline, the last line disappears in the HTML diff.

> puts Diffy::Diff.new("1\n2", "1\n2\n").to_s
 1
-2
\ No newline at end of file
+2
 => nil
> puts Diffy::Diff.new("1\n2", "1\n2\n").to_s(:html)
<div class="diff">
  <ul>
    <li class="unchanged"><span>1</span></li>
  </ul>
</div>
 => nil
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant