Closed (won't fix)
Project:
GeSHi Filter for syntax highlighting
Version:
6.x-1.3
Component:
Filtering
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
28 Sep 2010 at 05:04 UTC
Updated:
22 Jun 2011 at 23:13 UTC
Comments
Comment #1
soxofaan commentedHi DynV,
I'm afraid this is not possible. As far as I know there are no such features in the GeSHi library that the Geshifilter Drupal module (which is just a wrapper around the external library) could leverage.
A possible workarounds:
- fix it with an extra input filter that comes after GeSHifilter
- do it client side with some jQuery magic
Comment #2
dynv commentedsoxofaan
I suppose that mean that the feature request would have to be made at the GeSHi library?
soxofaan
Could you give me a hint on how to do that? I don't have the slightest idea how to proceed. :|
Comment #3
soxofaan commentedThat kind of feature request should indeed be made against the GeSHi library.
About the workaround input filter: I can't provide full support on this, but basically it involves implementing a custom module that implements hook_filter.
Comment #4
dynv commentedI could make a simple module transforming < to < and > to > but I only want this to be done when GeSHi Filter was used so I'm wondering if there's a way to find out if it was used. I could always rip the code from your module which seek conditions to apply the library but that's redundant and I'd need to check all your updates too see it that changed, so either integrate that to your module or (what seems like a better long-term solution) add an API to your module (if there isn't already a way to fetch such information).
Edit 1:
Beside the ideal situation of using an API with your module, it seem the best workaround would be to fetch what's in the tags <span class="geshifilter"> then apply the filter to that. Regex communities ardently make the promotion of HTML parsers, here's just an example (Do NOT try parsing with regular expressions) why, thus I'd go that way. I tried finding such a module for Drupal and the closest I could find on the matter was Differcence between xpath parser project and XML parser project which both solutions have dependencies, so creating the module with them would have 2 levels of dependencies. :\
Instead of me creating a standalone module to patch GeSHi, couldn't the filter be added to your module separately, it could even be identified as optional ; this seem preferable to adding a project, you could even create a branch to your project assigned to me that you'd distance yourself from if you want.
Edit 2:
Instead of creating another module, I could create a patch wrapping $geshi->parse_code() in geshifilter_geshi_process() (from geshifilter.pages.inc), perhaps verifying a setting that I'd insert first.
I suppose I could implement myself, just for Drupal, the process attribute I made up by verifying if it's contained in the variables assigned by _geshifilter_get_tags() and removing the instances where it's contained, again adding a setting.
Both could be in a separated section and disabled by default, it could even be mention it's not implemented by the main maintainer to distance yourself from it. I'm waiting for your feedback before proceeding.
Edit 3:
In the settings, I think there should be a check-box linked to the Generic syntax highlighting tags field which would require the language attribute for them to proceed (activate the GeSHi syntax highlighting).
Comment #5
boombatower commentedSeems like this is an upstream request or custom module as already noted. Closing due to inactivity.