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

Diffs with literal \n cause extra line breaks in diff #113

Open
JasonBarnabe opened this issue Jan 23, 2021 · 3 comments
Open

Diffs with literal \n cause extra line breaks in diff #113

JasonBarnabe opened this issue Jan 23, 2021 · 3 comments

Comments

@JasonBarnabe
Copy link
Contributor

# Note single quotes - \n is not a line break.
puts Diffy::Diff.new('foo\nbar', 'boo\nfar').to_s(:html)

Expected:

<div class="diff">
  <ul>
    <li class="del"><del><strong>foo\nb</strong>ar</del></li>
    <li class="ins"><ins><strong>boo\nf</strong>ar</ins></li>
  </ul>
</div>

Actual:

<div class="diff">
  <ul>
    <li class="del"><del><strong>f</strong>oo</del></li>
    <li class="del"><del><strong>b</strong>ar</del></li>
    <li class="ins"><ins><strong>b</strong>oo</ins></li>
    <li class="ins"><ins><strong>f</strong>ar</ins></li>
  </ul>
</div>
@cristianocca
Copy link

Any updates or work arounds for this?

@ErCargo
Copy link

ErCargo commented Oct 11, 2023 via email

@panozzaj
Copy link

panozzaj commented Nov 2, 2024

Perhaps the same or similar to #96

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

4 participants