Differential D11680 Diff 28251 src/infrastructure/markup/interpreter/PhabricatorRemarkupCowsayBlockInterpreter.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/markup/interpreter/PhabricatorRemarkupCowsayBlockInterpreter.php
Show All 31 Lines | public function markupContent($content, array $argv) { | ||||
$future->setTimeout(15); | $future->setTimeout(15); | ||||
$future->write($content); | $future->write($content); | ||||
list($err, $stdout, $stderr) = $future->resolve(); | list($err, $stdout, $stderr) = $future->resolve(); | ||||
if ($err) { | if ($err) { | ||||
return $this->markupError( | return $this->markupError( | ||||
pht( | pht( | ||||
'Execution of `cowsay` failed:', $stderr)); | 'Execution of `%s` failed: %s', | ||||
'cowsay', | |||||
$stderr)); | |||||
} | } | ||||
if ($this->getEngine()->isTextMode()) { | if ($this->getEngine()->isTextMode()) { | ||||
return $stdout; | return $stdout; | ||||
} | } | ||||
return phutil_tag( | return phutil_tag( | ||||
'div', | 'div', | ||||
array( | array( | ||||
'class' => 'PhabricatorMonospaced remarkup-cowsay', | 'class' => 'PhabricatorMonospaced remarkup-cowsay', | ||||
), | ), | ||||
$stdout); | $stdout); | ||||
} | } | ||||
} | } |