Differential D8953 Diff 21309 src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupQuotesBlockRule.php
Changeset View
Changeset View
Standalone View
Standalone View
src/markup/engine/remarkup/blockrule/PhutilRemarkupEngineRemarkupQuotesBlockRule.php
Show All 21 Lines | if (preg_match("/^>/", $lines[$cursor])) { | ||||
break; | break; | ||||
} | } | ||||
} | } | ||||
return $num_lines; | return $num_lines; | ||||
} | } | ||||
public function markupText($text) { | public function markupText($text, $children) { | ||||
$lines = array(); | $lines = array(); | ||||
foreach (explode("\n", $text) as $line) { | foreach (explode("\n", $text) as $line) { | ||||
$lines[] = $this->applyRules(preg_replace('/^>\s*/', '', $line)); | $lines[] = $this->applyRules(preg_replace('/^>\s*/', '', $line)); | ||||
} | } | ||||
if ($this->getEngine()->isTextMode()) { | if ($this->getEngine()->isTextMode()) { | ||||
return '> '.implode("\n> ", $lines); | return '> '.implode("\n> ", $lines); | ||||
} | } | ||||
return hsprintf( | return hsprintf( | ||||
'<blockquote><p>%s</p></blockquote>', | '<blockquote><p>%s</p></blockquote>', | ||||
phutil_implode_html(phutil_tag('br'), $lines)); | phutil_implode_html(phutil_tag('br'), $lines)); | ||||
} | } | ||||
} | } |