Skip to content

Commit ea7e59e

Browse files
MatmaRexramsey
authored andcommitted
Use -P rather than -O when passing options
To allow option values containing commas. -P is new in Pygments 0.9. http://pygments.org/docs/cmdline/#options-and-filters Fixes kzykhys#4.
1 parent c574b72 commit ea7e59e

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/KzykHys/Pygments/Pygments.php

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,9 @@ public function highlight($code, $lexer = null, $formatter = null, $options = ar
5353
}
5454

5555
if (count($options)) {
56-
$arg = array();
57-
5856
foreach ($options as $key => $value) {
59-
$arg[] = sprintf('%s=%s', $key, $value);
57+
$builder->add('-P')->add(sprintf('%s=%s', $key, $value));
6058
}
61-
62-
$builder->add('-O')->add(implode(',', $arg));
6359
}
6460

6561
$process = $builder->getProcess()->setStdin($code);

0 commit comments

Comments
 (0)