File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -668,9 +668,13 @@ fn render_difference(diff: &html_diff::Difference) {
668
668
elem. path, elem. element_name, elem_attributes, opposite_elem_attributes) ;
669
669
}
670
670
html_diff:: Difference :: NodeText { ref elem, ref elem_text, ref opposite_elem_text, .. } => {
671
- let ( s1, s2) = concise_compared_strs ( elem_text, opposite_elem_text) ;
672
- println ! ( " {} Text differs:\n expected: `{}`\n found: `{}`" ,
673
- elem. path, s1, s2) ;
671
+ if elem_text. split ( "\n " )
672
+ . zip ( opposite_elem_text. split ( "\n " ) )
673
+ . any ( |( a, b) | a. trim ( ) != b. trim ( ) ) {
674
+ let ( s1, s2) = concise_compared_strs ( elem_text, opposite_elem_text) ;
675
+ println ! ( " {} Text differs:\n expected: `{}`\n found: `{}`" ,
676
+ elem. path, s1, s2) ;
677
+ }
674
678
}
675
679
html_diff:: Difference :: NotPresent { ref elem, ref opposite_elem } => {
676
680
if let Some ( ref elem) = * elem {
You can’t perform that action at this time.
0 commit comments