From c0b9b6db549b5320039b1b9c4efb729571348cf9 Mon Sep 17 00:00:00 2001 From: epriestley Date: Mon, 22 Oct 2012 16:24:22 -0700 Subject: [PATCH] Don't count "\r" or "\n" for purposes of linewrapping text in Differential Summary: This should all go away at some point when we move to fluid layout, but don't be more annoying than necessary in the meantime. Test Plan: Meta. Reviewers: vrana, btrahan Reviewed By: vrana CC: aran Differential Revision: https://secure.phabricator.com/D3788 --- .../differential/parser/DifferentialChangesetParser.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/applications/differential/parser/DifferentialChangesetParser.php b/src/applications/differential/parser/DifferentialChangesetParser.php index 3abaed95ce..5602b79cda 100644 --- a/src/applications/differential/parser/DifferentialChangesetParser.php +++ b/src/applications/differential/parser/DifferentialChangesetParser.php @@ -818,7 +818,9 @@ final class DifferentialChangesetParser { $text, $intra[$key]); } - if (isset($corpus[$key]) && strlen($corpus[$key]) > $this->lineWidth) { + if (isset($corpus[$key]) && + strlen($corpus[$key]) > $this->lineWidth && + strlen(rtrim($corpus[$key], "\r\n")) > $this->lineWidth) { $lines = phutil_utf8_hard_wrap_html($render[$key], $this->lineWidth); $render[$key] = implode($line_break, $lines); }