Differential D11731 Diff 28263 src/infrastructure/markup/interpreter/PhabricatorRemarkupFigletBlockInterpreter.php
Changeset View
Changeset View
Standalone View
Standalone View
src/infrastructure/markup/interpreter/PhabricatorRemarkupFigletBlockInterpreter.php
Show All 18 Lines | $future = id(new ExecFuture('figlet -f %s', $safe_font)) | ||||
->setTimeout(15) | ->setTimeout(15) | ||||
->write(trim($content, "\n")); | ->write(trim($content, "\n")); | ||||
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 `figlet` failed:', $stderr)); | 'Execution of `%s` failed: %s', | ||||
'figlet', | |||||
$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-figlet', | 'class' => 'PhabricatorMonospaced remarkup-figlet', | ||||
), | ), | ||||
$stdout); | $stdout); | ||||
} | } | ||||
} | } |