Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F13982599
D8235.id.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D8235.id.diff
View Options
Index: src/infrastructure/markup/interpreter/PhabricatorRemarkupBlockInterpreterGraphviz.php
===================================================================
--- src/infrastructure/markup/interpreter/PhabricatorRemarkupBlockInterpreterGraphviz.php
+++ src/infrastructure/markup/interpreter/PhabricatorRemarkupBlockInterpreterGraphviz.php
@@ -13,6 +13,8 @@
pht('Unable to locate the `dot` binary. Install Graphviz.'));
}
+ $width = $this->parseDimension(idx($argv, 'width'));
+
$future = id(new ExecFuture('dot -T%s', 'png'))
->setTimeout(15)
->write(trim($content));
@@ -41,7 +43,19 @@
'img',
array(
'src' => $file->getBestURI(),
+ 'width' => nonempty($width, null),
));
}
+ // TODO: This is duplicated from PhabricatorRemarkupRuleEmbedFile 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/plain
Expires
Mon, Oct 21, 12:33 AM (3 w, 2 d ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6730039
Default Alt Text
D8235.id.diff (1 KB)
Attached To
Mode
D8235: Add ability to pass `width` arg to dot remarkup interpeter
Attached
Detach File
Event Timeline
Log In to Comment