I recently downloaded and installed GeSHi Filter for my site. Am I only able to use the Filter by creating a new source code node? I am trying to use the filter inside of a blog post with no such luck. I am using the format:

<code type="php">
// testing
var_dump($value);
echo 'Is this working?';
...

Any help is greatly appreciated.

Thanks,
~ JimmyJam

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

soxofaan’s picture

just installing GeSHi filter is not enough, you have to enable the GeSHi filter in an input format and use that input format for your blog body.

from the help at yoursite.com/?q=admin/help/geshifilter:

Quick overview of how to set up and use the GeSHi filter:

* Install the GeSHi library and specify its path on the GeSHi filter administration page.
* Configure the general GeSHi filter settings.
* Enable the relevant languages for your site.
* Enable the GeSHi filter in the desired input formats.
* Check for filter conflicts and resolve them.
* Use the input format during content submission as described in the filter tips.

(also note that the source code node is deprecated and will be replaced by a GeSHi CCK field in the future)

BassistJimmyJam’s picture

I have followed all of these steps and I am using the Full HTML Input Format which is setup to use the GeSHi filter. I have even tried using <php> tags, which I did setup, but this still does nothing. It seems as if the content isn't even being processed by the filter. I have the filter setup to use <pre> tags, but when I view the source of the published entry, I do not see them.

soxofaan’s picture

Status: Active » Postponed (maintainer needs more info)

This is probably due to a conflict between filters. For example, the html filter should come before the GeSHi filter. Check the "filter conflicts" tab on the GeSHi filter settings page.

If this does not help, please create a new input format, with only the GeSHi filter enabled and check if the filtering works with this new input format.

BassistJimmyJam’s picture

According to the "filter conflicts" tab, there are no known conflicts. I created a new input format with only the GeSHi filter enabled and it still does not work. I am still not even getting <pre> tags around my code.

soxofaan’s picture

FileSize
1.6 KB
265 bytes

can you give an example of input and resulting output?
please attach as files because the markup would be messed up in these comments

In attachment: the output I get for the given input
settings:
* input format: urlfilter+htmlfilter+linebreakfilter+geshifilter
* inline CSS, pre container
* GeSHi Library 1.0.7.20
* <foo> and [foo] tags
* C++ language enabled

BassistJimmyJam’s picture

FileSize
378 bytes
278 bytes

I have used the exact same setting that you described and it still did not work. I am currently using version 1.0.7.21 GeSHi Library. My results are attached.

soxofaan’s picture

hmm, from your results it seems like GeSHiFilter is not invoked in any way

I attached some screenshots of my settings to make sure we are on the same page

BassistJimmyJam’s picture

I changed the "Default highlighting mode" to "As plain text" to match your settings. I had it set to "Do nothing" at first. Now everything works fine. I still don't see why this wasn't working with my previous setting, since my <code> tags included the language="php" attribute.

The important thing is that it is working now. Thanks a lot for everyone's help.

Thanks,
~ JimmyJam

soxofaan’s picture

Title: Using In Blog Entry » problem with default lang="do nothing"
Version: 6.x-1.0 » 6.x-1.x-dev
Assigned: Unassigned » soxofaan
Category: support » bug
Status: Postponed (maintainer needs more info) » Active

your problem is solved,

but this is a bug
"do nothing" should be overruled by language="cpp" and such

soxofaan’s picture

Status: Active » Needs review
FileSize
11.55 KB

first iteration of a patch to fix this
patch could be smaller, but to make it more elegant I did some refactoring

still to do: add SimpleTest tests

soxofaan’s picture

Version: 6.x-1.x-dev » 5.x-2.x-dev
Status: Needs review » Patch (to be ported)

Fixed for HEAD (drupal 6 version) by http://drupal.org/cvs?commit=113914

problem also exists in 5.x-2.x-dev

soxofaan’s picture

Status: Patch (to be ported) » Fixed

fixed for 5.x-2.x-dev by http://drupal.org/cvs?commit=113917

Anonymous’s picture

Status: Fixed » Closed (fixed)

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