Page MenuHomePhabricator

D21295.diff
No OneTemporary

D21295.diff

diff --git a/src/infrastructure/diff/prose/PhutilProseDifferenceEngine.php b/src/infrastructure/diff/prose/PhutilProseDifferenceEngine.php
--- a/src/infrastructure/diff/prose/PhutilProseDifferenceEngine.php
+++ b/src/infrastructure/diff/prose/PhutilProseDifferenceEngine.php
@@ -148,7 +148,7 @@
// whitespace at the end.
$matches = null;
- preg_match('/^(\s*)(.*?)(\s*)\z/', $result, $matches);
+ preg_match('/^(\s*)(.*?)(\s*)\z/s', $result, $matches);
if (strlen($matches[1])) {
$results[] = $matches[1];
diff --git a/src/infrastructure/diff/prose/__tests__/PhutilProseDiffTestCase.php b/src/infrastructure/diff/prose/__tests__/PhutilProseDiffTestCase.php
--- a/src/infrastructure/diff/prose/__tests__/PhutilProseDiffTestCase.php
+++ b/src/infrastructure/diff/prose/__tests__/PhutilProseDiffTestCase.php
@@ -30,6 +30,14 @@
),
pht('Remove Paragraph'));
+ $this->assertProseParts(
+ 'xxx',
+ "xxxyyy\n.zzz",
+ array(
+ '= xxx',
+ "+ yyy\n.zzz",
+ ),
+ pht('Amend paragraph, and add paragraph starting with punctuation'));
// Without smoothing, the alogorithm identifies that "shark" and "cat"
// both contain the letter "a" and tries to express this as a very

File Metadata

Mime Type
text/plain
Expires
Sat, Mar 8, 10:44 AM (1 d, 20 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
7381914
Default Alt Text
D21295.diff (1 KB)

Event Timeline