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 @@ -660,9 +660,13 @@ fn render_difference(diff: &html_diff::Difference) {
660
660
elem. path, elem. element_name, elem_attributes, opposite_elem_attributes) ;
661
661
}
662
662
html_diff:: Difference :: NodeText { ref elem, ref elem_text, ref opposite_elem_text, .. } => {
663
- let ( s1, s2) = concise_compared_strs ( elem_text, opposite_elem_text) ;
664
- println ! ( " {} Text differs:\n expected: `{}`\n found: `{}`" ,
665
- elem. path, s1, s2) ;
663
+ if elem_text. split ( "\n " )
664
+ . zip ( opposite_elem_text. split ( "\n " ) )
665
+ . any ( |( a, b) | a. trim ( ) != b. trim ( ) ) {
666
+ let ( s1, s2) = concise_compared_strs ( elem_text, opposite_elem_text) ;
667
+ println ! ( " {} Text differs:\n expected: `{}`\n found: `{}`" ,
668
+ elem. path, s1, s2) ;
669
+ }
666
670
}
667
671
html_diff:: Difference :: NotPresent { ref elem, ref opposite_elem } => {
668
672
if let Some ( ref elem) = * elem {
You can’t perform that action at this time.
0 commit comments