Differential D8953 Diff 21309 src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupDefaultBlockRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupDefaultBlockRule.php
<?php | <?php | ||||
/** | /** | ||||
* @group markup | * @group markup | ||||
*/ | */ | ||||
final class PhutilRemarkupEngineRemarkupDefaultBlockRule | final class PhutilRemarkupEngineRemarkupDefaultBlockRule | ||||
extends PhutilRemarkupEngineBlockRule { | extends PhutilRemarkupEngineBlockRule { | ||||
public function getPriority() { | public function getPriority() { | ||||
return 750; | return 750; | ||||
} | } | ||||
public function getMatchingLineCount(array $lines, $cursor) { | public function getMatchingLineCount(array $lines, $cursor) { | ||||
return 1; | return 1; | ||||
} | } | ||||
public function markupText($text) { | public function markupText($text, $children) { | ||||
$text = trim($text); | $text = trim($text); | ||||
$text = $this->applyRules($text); | $text = $this->applyRules($text); | ||||
if ($this->getEngine()->isTextMode()) { | if ($this->getEngine()->isTextMode()) { | ||||
if (!$this->getEngine()->getConfig('preserve-linebreaks')) { | if (!$this->getEngine()->getConfig('preserve-linebreaks')) { | ||||
$text = preg_replace('/ *\n */', ' ', $text); | $text = preg_replace('/ *\n */', ' ', $text); | ||||
} | } | ||||
return $text; | return $text; | ||||
Show All 14 Lines |