Page MenuHomePhabricator

D8235.id.diff
No OneTemporary

D8235.id.diff

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

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)

Event Timeline