Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/diff/prose/PhutilProseDifferenceEngine.php
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | for ($ii = 0; $ii < $count; $ii += 2) { | ||||
if ($level < 2) { | if ($level < 2) { | ||||
// Split pieces into separate text and whitespace sections: make one | // Split pieces into separate text and whitespace sections: make one | ||||
// piece out of all the whitespace at the beginning, one piece out of | // piece out of all the whitespace at the beginning, one piece out of | ||||
// all the actual text in the middle, and one piece out of all the | // all the actual text in the middle, and one piece out of all the | ||||
// whitespace at the end. | // whitespace at the end. | ||||
$matches = null; | $matches = null; | ||||
preg_match('/^(\s*)(.*?)(\s*)\z/', $result, $matches); | preg_match('/^(\s*)(.*?)(\s*)\z/s', $result, $matches); | ||||
if (strlen($matches[1])) { | if (strlen($matches[1])) { | ||||
$results[] = $matches[1]; | $results[] = $matches[1]; | ||||
} | } | ||||
if (strlen($matches[2])) { | if (strlen($matches[2])) { | ||||
$results[] = $matches[2]; | $results[] = $matches[2]; | ||||
} | } | ||||
if (strlen($matches[3])) { | if (strlen($matches[3])) { | ||||
▲ Show 20 Lines • Show All 116 Lines • Show Last 20 Lines |