We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
We have strings with a backslash (\) followed by the letter n, where the diff does not display correctly on our web site.
\
n
Apparently the diffy gem when using to_s(:html) is splitting a string with a backslash (\) character followed by an n character into two lines.
to_s(:html)
irb(main):001:0> puts Diffy::Diff.new("A\\nZ", "B\\nZ").to_s(:html) <div class="diff"> <ul> <li class="del"><del><strong>A</strong></del></li> <li class="del"><del>Z</del></li> <li class="ins"><ins><strong>B</strong></ins></li> <li class="ins"><ins>Z</ins></li> </ul> </div> => nil irb(main):002:0> puts Diffy::Diff.new("A\\\\nZ", "B\\\\nZ").to_s(:html) <div class="diff"> <ul> <li class="del"><del><strong>A</strong>\</del></li> <li class="del"><del>Z</del></li> <li class="ins"><ins><strong>B</strong>\</ins></li> <li class="ins"><ins>Z</ins></li> </ul> </div> => nil
When there are two backslashes and an r, diffy gets completely confused.
r
irb(main):003:0> puts Diffy::Diff.new("A\\\\r\\\\nZ", "B\\\\r\\\\nZ").to_s(:html) <div class="diff"> <ul> \</del></li>s="del"><del><strong>A</strong>\ <li class="del"><del>Z</del></li> \</ins></li>s="ins"><ins><strong>B</strong>\ <li class="ins"><ins>Z</ins></li> </ul> </div> => nil
The text was updated successfully, but these errors were encountered:
No branches or pull requests
We have strings with a backslash (
\
) followed by the lettern
, where the diff does not display correctly on our web site.Apparently the diffy gem when using
to_s(:html)
is splitting a string with a backslash (\
) character followed by ann
character into two lines.When there are two backslashes and an
r
, diffy gets completely confused.The text was updated successfully, but these errors were encountered: