/** * Helper function for overriding some GeSHi defaults. * * @param \Geshi $geshi * Geshi object. * @param string $langcode * The language. */ public static function overrideGeshiDefaults(\Geshi &$geshi, $langcode) { $config = \Drupal::config('geshifilter.settings'); // Override the some default GeSHi styles (e.g. GeSHi uses Courier by // default, which is ugly). $geshi->set_line_style('font-family: monospace; font-weight: normal;', 'font-family: monospace; font-weight: bold; font-style: italic;'); $geshi->set_code_style('font-family: monospace; font-weight: normal; font-style: normal'); // Overall class needed for CSS. $geshi->set_overall_class('geshifilter-' . $langcode); // Set keyword linking. $geshi->enable_keyword_links($config->get('enable_keyword_urls', TRUE)); }