Differential D8953 Diff 21309 src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupCodeBlockRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupCodeBlockRule.php
Show All 40 Lines | while (isset($lines[$cursor])) { | ||||
$num_lines++; | $num_lines++; | ||||
} | } | ||||
$cursor++; | $cursor++; | ||||
} | } | ||||
return $num_lines; | return $num_lines; | ||||
} | } | ||||
public function markupText($text) { | public function markupText($text, $children) { | ||||
if (preg_match('/^```/', $text)) { | if (preg_match('/^```/', $text)) { | ||||
// If this is a ```-style block, trim off the backticks and any leading | // If this is a ```-style block, trim off the backticks and any leading | ||||
// blank line. | // blank line. | ||||
$text = preg_replace('/^```(\s*\n)?/', '', $text); | $text = preg_replace('/^```(\s*\n)?/', '', $text); | ||||
$text = preg_replace('/```\s*$/', '', $text); | $text = preg_replace('/```\s*$/', '', $text); | ||||
} | } | ||||
$lines = explode("\n", $text); | $lines = explode("\n", $text); | ||||
▲ Show 20 Lines • Show All 133 Lines • Show Last 20 Lines |