Differential D17772 Diff 42753 src/markup/engine/remarkup/blockrule/PhutilRemarkupLiteralBlockRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/markup/engine/remarkup/blockrule/PhutilRemarkupLiteralBlockRule.php
Show All 20 Lines | public function getMatchingLineCount(array $lines, $cursor) { | ||||
// different blocks. This more clearly represents the original text in the | // different blocks. This more clearly represents the original text in the | ||||
// output text and assists automated escaping of blocks coming into the | // output text and assists automated escaping of blocks coming into the | ||||
// system. | // system. | ||||
$num_lines = 0; | $num_lines = 0; | ||||
while (preg_match('/^\s*%%%/', $lines[$cursor])) { | while (preg_match('/^\s*%%%/', $lines[$cursor])) { | ||||
$num_lines++; | $num_lines++; | ||||
// If the line has ONLY "%%%", the block opener doesn't get to double | |||||
// up as a block terminator. | |||||
if (preg_match('/^\s*%%%\s*\z/', $lines[$cursor])) { | |||||
$num_lines++; | |||||
$cursor++; | |||||
} | |||||
while (isset($lines[$cursor])) { | while (isset($lines[$cursor])) { | ||||
if (!preg_match('/%%%\s*$/', $lines[$cursor])) { | if (!preg_match('/%%%\s*$/', $lines[$cursor])) { | ||||
$num_lines++; | $num_lines++; | ||||
$cursor++; | $cursor++; | ||||
continue; | continue; | ||||
} | } | ||||
break; | break; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 50 Lines • Show Last 20 Lines |