Since the hook_filter is only called on content creation/update the call to drupal_add_css() in texy_syntaxhighlighting_texy_handler() does not get executed on content view.

To solve it the css inclusion can be placed in a hook_init() function like the following:

function texy_syntaxhighlighting_init() {
    if (variable_get('texy_syntaxhighlighting_use', FALSE)) {
        // attach a stylesheet for the syntax highlighter
        $css = variable_get('texy_syntaxhighlighting_css_path', FALSE);
        if ( !empty($css) ) {
            $path = drupal_get_path('module', 'texy_syntaxhighlighting');
            drupal_add_css($path .'/lib/'. $css);
        }
    }
}

Comments

tomaszx’s picture

Status: Active » Reviewed & tested by the community

Hi,

thanks for your code @DrSlump

it works perfectly. this must be inside module.

havran’s picture

Version: 6.x-1.0-beta1 » 6.x-1.x-dev
Status: Reviewed & tested by the community » Fixed

Fixed in 6.x-1.x-dev.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.