Differential D8953 Diff 21309 src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineBlockRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineBlockRule.php
Show All 18 Lines | abstract class PhutilRemarkupEngineBlockRule { | ||||
* list. | * list. | ||||
* | * | ||||
* @return float Priority at which this block should execute. | * @return float Priority at which this block should execute. | ||||
*/ | */ | ||||
public function getPriority() { | public function getPriority() { | ||||
return 500.0; | return 500.0; | ||||
} | } | ||||
abstract public function markupText($text); | abstract public function markupText($text, $children); | ||||
/** | /** | ||||
* This will get an array of unparsed lines and return the number of lines | * This will get an array of unparsed lines and return the number of lines | ||||
* from the first array value that it can parse. | * from the first array value that it can parse. | ||||
* | * | ||||
* @param array $lines | * @param array $lines | ||||
* @param int $cursor | * @param int $cursor | ||||
* | * | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | abstract class PhutilRemarkupEngineBlockRule { | ||||
final protected function applyRules($text) { | final protected function applyRules($text) { | ||||
foreach ($this->getMarkupRules() as $rule) { | foreach ($this->getMarkupRules() as $rule) { | ||||
$text = $rule->apply($text); | $text = $rule->apply($text); | ||||
} | } | ||||
return $text; | return $text; | ||||
} | } | ||||
public function supportsChildBlocks() { | |||||
return false; | |||||
} | |||||
public function extractChildText($text) { | |||||
throw new Exception(pht('Not implemnted!')); | |||||
} | |||||
protected function renderRemarkupTable(array $out_rows) { | protected function renderRemarkupTable(array $out_rows) { | ||||
assert_instances_of($out_rows, 'array'); | assert_instances_of($out_rows, 'array'); | ||||
if ($this->getEngine()->isTextMode()) { | if ($this->getEngine()->isTextMode()) { | ||||
$lengths = array(); | $lengths = array(); | ||||
foreach ($out_rows as $r => $row) { | foreach ($out_rows as $r => $row) { | ||||
foreach ($row['content'] as $c => $cell) { | foreach ($row['content'] as $c => $cell) { | ||||
$text = $this->getEngine()->restoreText($cell['content']); | $text = $this->getEngine()->restoreText($cell['content']); | ||||
▲ Show 20 Lines • Show All 44 Lines • Show Last 20 Lines |