Differential D14247 Diff 34398 src/markup/engine/remarkup/blockrule/PhutilRemarkupQuotesBlockRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/markup/engine/remarkup/blockrule/PhutilRemarkupQuotesBlockRule.php
Show All 23 Lines | foreach ($text as $key => $line) { | ||||
$text[$key] = substr($line, 1); | $text[$key] = substr($line, 1); | ||||
} | } | ||||
return array('', implode('', $text)); | return array('', implode('', $text)); | ||||
} | } | ||||
public function markupText($text, $children) { | public function markupText($text, $children) { | ||||
if ($this->getEngine()->isTextMode()) { | if ($this->getEngine()->isTextMode()) { | ||||
$lines = phutil_split_lines($children); | $lines = rtrim($children, "\n"); | ||||
return '> '.implode("\n> ", $lines); | $lines = phutil_split_lines($lines); | ||||
foreach ($lines as $key => $line) { | |||||
if (isset($line[0]) && ($line[0] == '>')) { | |||||
$line = '>'.$line; | |||||
} else { | |||||
$line = '> '.$line; | |||||
} | |||||
$lines[$key] = $line; | |||||
} | |||||
return implode('', $lines); | |||||
} | } | ||||
return phutil_tag( | return phutil_tag( | ||||
'blockquote', | 'blockquote', | ||||
array(), | array(), | ||||
$children); | $children); | ||||
} | } | ||||
} | } |