Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F15331507
D21295.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D21295.diff
View Options
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
Details
Attached
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)
Attached To
Mode
D21295: Correct a prose diff behavior when prose pieces include newlines
Attached
Detach File
Event Timeline
Log In to Comment