1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-12-19 12:00:55 +01:00

Pass the new default syntax highlighting map to the remarkup engine

Summary: Ref T9790. This passes the map down so we can generate highlighted mail.

Test Plan:
Generated this relatively respectable-looking HTML mail:

{F1258558}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T9790

Differential Revision: https://secure.phabricator.com/D15848
This commit is contained in:
epriestley 2016-05-04 18:42:47 -07:00
parent 01289f3f48
commit 19aac8e8d3
2 changed files with 18 additions and 0 deletions

View file

@ -480,6 +480,10 @@ final class PhabricatorMarkupEngine extends Phobject {
'syntax-highlighter.engine',
$options['syntax-highlighter.engine']);
$style_map = id(new PhabricatorDefaultSyntaxStyle())
->getRemarkupStyleMap();
$engine->setConfig('phutil.codeblock.style-map', $style_map);
$engine->setConfig('uri.full', $options['uri.full']);
$rules = array();

View file

@ -27,4 +27,18 @@ abstract class PhabricatorSyntaxStyle extends Phobject {
->execute();
}
final public function getRemarkupStyleMap() {
$map = array(
'rbw_r' => 'color: red',
'rbw_o' => 'color: orange',
'rbw_y' => 'color: yellow',
'rbw_g' => 'color: green',
'rbw_b' => 'color: blue',
'rbw_i' => 'color: indigo',
'rbw_v' => 'color: violet',
);
return $map + $this->getStyleMap();
}
}