Page MenuHomePhabricator

D8235.diff
No OneTemporary

D8235.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
Sat, Nov 9, 12:01 PM (3 d, 14 h ago)
Storage Engine
blob
Storage Format
Encrypted (AES-256-CBC)
Storage Handle
6730039
Default Alt Text
D8235.diff (1 KB)

Event Timeline