From 35a250235f4224b89b951605f079d7aa3c184f26 Mon Sep 17 00:00:00 2001 From: Jack Cherng Date: Mon, 10 Aug 2020 23:35:41 +0800 Subject: [PATCH] fix: \r shouldn't be visualized like a newline in Combined renderer https://github.com/jfcherng/php-diff/issues/34 Signed-off-by: Jack Cherng --- example/diff-table.css | 7 ++++++- example/diff-table.scss | 9 +++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/example/diff-table.css b/example/diff-table.css index 753b47df..a4fde2ec 100644 --- a/example/diff-table.css +++ b/example/diff-table.css @@ -75,6 +75,9 @@ .diff-wrapper.diff.diff-html { white-space: pre-wrap; } +.diff-wrapper.diff.diff-html.diff-combined .change.change-rep .rep { + white-space: normal; +} .diff-wrapper.diff.diff-html .change.change-eq .old, .diff-wrapper.diff.diff-html .change.change-eq .new { background: #fff; @@ -88,7 +91,9 @@ .diff-wrapper.diff.diff-html .change .rep { background: #fef6d9; } -.diff-wrapper.diff.diff-html .change .old.none, .diff-wrapper.diff.diff-html .change .new.none, .diff-wrapper.diff.diff-html .change .rep.none { +.diff-wrapper.diff.diff-html .change .old.none, +.diff-wrapper.diff.diff-html .change .new.none, +.diff-wrapper.diff.diff-html .change .rep.none { background: transparent; cursor: not-allowed; } diff --git a/example/diff-table.scss b/example/diff-table.scss index 74410902..025e8c61 100644 --- a/example/diff-table.scss +++ b/example/diff-table.scss @@ -123,6 +123,15 @@ $diff-bg-color-none-block-alternative: mix($diff-bg-color, $diff-table-sidebar-c &.diff-html { white-space: pre-wrap; + &.diff-combined { + .change.change-rep { + .rep { + // fixes https://github.com/jfcherng/php-diff/issues/34#issuecomment-671404456 + white-space: normal; + } + } + } + .change { &.change-eq { .old,