Hi
I'm trying to make GeSHi translate the following string into ActionScript
[syntax="actionscript"]var foo:String = "bar";[/syntax]
I understand that I need to define a custom tag for the ActionScript language, but exactly how should the tags be formatted?
I've tried
[syntax="actionscript"][/syntax]
but that doesn't seem to work.
Comments
Comment #1
soxofaan commentedAfter enabling ActionScript as language in the "Languages" configuration tab, you can for example use these:
[code lang="actionscript"]foo[/code]
[code language="actionscript"]foo[/code]
[code type="actionscript"]foo[/code]
If you set the custom language tag "actionscript" for ActionScript, you can also use
[actionscript]foo[/actionscript]
from http://drupal.org/project/geshifilter:
Comment #2
thulstrup commentedThank you for your answer, but thats not quite what I'm looking for.
I already have a lot of data where the format is:
[syntax="actionscript"]var foo:String = "bar";[/syntax].
Is it possible to have a custom language tag where the start tag and end tag is different?
Start tag: [syntax="actionscript"]
End tag: [/syntax]?
Comment #3
tobto commentedI'm also interested into implementation of this
Comment #4
soxofaan commentedThis is not possible with current version of GeSHi filter.
At first sight, I'm not inclined in implementing this type of tags, since that would make the code (especially the regular expressions) too complex.
A possible solution for you is to implement a custom input filter that would translate
[syntax="actionscript"]...[/syntax]to[code language="actionscript"]...[/code]and place it before GeSHi filter, so you don't need to touch your dataset. This should be possible in 20 lines of code or something I guess.Comment #5
thulstrup commentedI wrote a small regex that seems to do the trick for me:
Comment #6
boombatower commentedSeems fixed and supper old, please re-open if still relevant to recent version.