1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-09-20 09:18:48 +02:00

Make two small fixes to the quoting feature

Summary:
Ref T4119.

  - Trim newlines off the quoted text before quoting it; otherwise we can end up with a staircase of ">" at the end of a quote.
  - Allow image macros to have leading whitespace, so multiple consecuitive quoted macros work properly.

Test Plan: I QUOTED MACROS A LOT OF TIMES

Reviewers: btrahan, chad

Reviewed By: chad

Subscribers: epriestley

Maniphest Tasks: T4119

Differential Revision: https://secure.phabricator.com/D8983
This commit is contained in:
epriestley 2014-05-05 11:23:12 -07:00
parent 2b4c551b0e
commit 85bc05be25
2 changed files with 2 additions and 1 deletions

View file

@ -12,7 +12,7 @@ final class PhabricatorRemarkupRuleImageMacro
public function apply($text) {
return preg_replace_callback(
'@^([a-zA-Z0-9:_\-]+)$@m',
'@^\s*([a-zA-Z0-9:_\-]+)$@m',
array($this, 'markupImageMacro'),
$text);
}

View file

@ -34,6 +34,7 @@ final class PhabricatorApplicationTransactionCommentQuoteController
}
$content = $xaction->getComment()->getContent();
$content = rtrim($content, "\r\n");
$content = phutil_split_lines($content, true);
foreach ($content as $key => $line) {
if (strlen($line) && ($line[0] != '>')) {