Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F2891225
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Award Token
Flag For Later
Advanced/Developer...
View Handle
View Hovercard
Size
2 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/src/infrastructure/markup/interpreter/PhabricatorRemarkupGraphvizBlockInterpreter.php b/src/infrastructure/markup/interpreter/PhabricatorRemarkupGraphvizBlockInterpreter.php
index e06432be6e..5ccf4fb7a9 100644
--- a/src/infrastructure/markup/interpreter/PhabricatorRemarkupGraphvizBlockInterpreter.php
+++ b/src/infrastructure/markup/interpreter/PhabricatorRemarkupGraphvizBlockInterpreter.php
@@ -1,64 +1,65 @@
<?php
final class PhabricatorRemarkupGraphvizBlockInterpreter
extends PhutilRemarkupBlockInterpreter {
public function getInterpreterName() {
return 'dot';
}
public function markupContent($content, array $argv) {
if (!Filesystem::binaryExists('dot')) {
return $this->markupError(
pht(
'Unable to locate the `%s` binary. Install Graphviz.',
'dot'));
}
$width = $this->parseDimension(idx($argv, 'width'));
$future = id(new ExecFuture('dot -T%s', 'png'))
->setTimeout(15)
->write(trim($content));
list($err, $stdout, $stderr) = $future->resolve();
if ($err) {
return $this->markupError(
pht(
'Execution of `%s` failed (#%d), check your syntax: %s',
'dot',
$err,
$stderr));
}
$file = PhabricatorFile::buildFromFileDataOrHash(
$stdout,
array(
'name' => 'graphviz.png',
));
if ($this->getEngine()->isTextMode()) {
return '<'.$file->getBestURI().'>';
}
- return phutil_tag(
+ $img = phutil_tag(
'img',
array(
'src' => $file->getBestURI(),
'width' => nonempty($width, null),
));
+ return phutil_tag_div('phabricator-remarkup-embed-image-full', $img);
}
// TODO: This is duplicated from PhabricatorEmbedFileRemarkupRule since they
// do not share a base class.
private function parseDimension($string) {
$string = trim($string);
if (preg_match('/^(?:\d*\\.)?\d+%?$/', $string)) {
return $string;
}
return null;
}
}
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sun, Jan 19, 14:51 (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1125681
Default Alt Text
(2 KB)
Attached To
Mode
rP Phorge
Attached
Detach File
Event Timeline
Log In to Comment