Open ablce9 opened 4 years ago
Note that using format html_simple
does not produce empty html tags, but the No newline message is not present.
[181] pry(main)> out = Diffy::SplitDiff.new("aaaaaaaaaa\n", "aaaaaaaaaa", format: :html_simple, allow_empty_diff: false)
=> #<Diffy::SplitDiff:0x00559873e4bb58
@diff="<div class=\"diff\">\n <ul>\n <li class=\"del\"><del>aaaaaaaaaa</del></li>\n <li class=\"ins\"><ins>aaaaaaaaaa</ins></li>\n\n </ul>\n</div>\n",
@format=:html_simple,
@left_diff="<div class=\"diff\">\n <ul>\n <li class=\"del\"><del>aaaaaaaaaa</del></li>\n\n </ul>\n</div>\n",
@right_diff="<div class=\"diff\">\n <ul>\n <li class=\"ins\"><ins>aaaaaaaaaa</ins></li>\n\n </ul>\n</div>\n">
Hi, first of all we really appreciate all of efforts diffy contributors are putting. Our product can not be thrived without diffy!
We have been noticing an unexpected behavior when comparing a text with a text containing a newline at end of file with HTML format like so:
This is like saying there is no diffs even though left text does end with
\n
. Most importantly, characters disappear!However, in TEXT format output is a bit different than that like so:
As you can see, both left and right diff are processed in text format, nicely denoting that
No newline at end of file
. We would expect the same, not empty html tags but actual newline diff with html tags.Before specifying this kind of behavior is a bug, we would like to know this(comparing with a text with newline in HTML format) is expected or not.
Thanks