All of geshis' output are block elements and since it takes over the <code> tag which is an inline element it doesn't behave as expected.
The code module used here on drupal is smart enough to know that inline code tags stayed that way. It was only when it contained a line break after <code> did it see it as a block.
Everything else works great. Thanks for picking it up. It's the closest version to being usable.
Comments
Comment #1
dvessel commentedJust looked over geshi's documentation. It looks like a limitation of geshi for now.
http://qbnz.com/highlighter/geshi-doc.html#the-code-container
Could you give the option to disable geshi for inline
<code>for the time being.?Comment #2
dvessel commentedUpdating the category since it's a feature request. No rush or anything but please make it happen. It's that's needed to get proper code to display.
Comment #3
pitpit commentedGeSHiFilter replace the whole <code> element by the GeSHi highlighted block arounded by the container (pre or div). Basically GeShi doesn't make possible to wrap the code in <code> tags.
I'm not sure to understand your request but are you suggesting GeSHIFilter should keep the <code> element away from the geshi parser when it contains no line break after and should display the element like that (ie without highlight and as an inline code element)?
Comment #4
dvessel commentedYes, that's exactly it. Please excuse the bad grammar.
This way at least the
<code>tag still functions as it was designed. Hopefully Nijel will work on this so geshi knows the difference. I could contacting him on this. He stated it might become an option in future versions.Codefilter does exactly this right now. Maybe look at their code? Thanks!
Comment #5
pitpit commentedwe could use another tag than <code> to lets inline code elements still function as there were designed.
Comment #6
dvessel commentedWhy do you think it should be another tag? In my limited view, keeping
<code>intact makes more sense. There are other input filter like textile or markdown for example that use a shorthand for<code>and other various tags. So, if what's entered is standard it's more likely to cooperate in more situations.Comment #7
pitpit commentedok
I just had a look on how codefilter deals with inline <code> tags and your request is more clear to me now. I agree with you that this feature is needed in GeSHiFilter.
I'll provide a patch asap. keep in touch.
Dpdev
Comment #8
dvessel commentedExcellent! Hope to try it out soon. I shot off an email to Nijel. It's not critical that Geshi supports inline code highlighting although it would be nice. It makes more sense for big blocks of code.
Comment #9
dvessel commentedI'm a little late with this but maybe consider using blockcode for geshi instead. It is xhtml2 and won't interfere with code.
http://www.w3.org/TR/xhtml2/mod-structural.html#sec_8.2.
Comment #10
nigel commentedHi guys :)
What you could do instead of using
Comment #11
nigel commentedgrr, there's me forgetting that HTML tags are actually HTML here :(
What I meant to say was...:
What you could do instead of using
<div>or<pre>is set the header type to GESHI_HEADER_NONE, and manually add the ... tags after highlighting. That way there won't be any<div>or<pre>in the output.Give that a go and see how it works :)
Comment #12
dvessel commentedWell, duh.. I read you the wrong way.
Comment #13
dvessel commentedbah! let me repeat that..
Well, duh.. I read you the wrong way.
So, yeah. let geshi take over a different tag like blockcode instead if it makes sense. I'm sorry, I can be an idiot. :)
Another thing is that when we have
<inside<code>tags it won't be escaped. :( Hopefully Nijels' suggestion takes care of that.Comment #14
pitpit commentedI committed a new release of geshifilter on cvs.
Now code is highlighted using <blockcode> tags. Inline code tag (<code>) can be enable in input format settings to allow inline code to be hightlighted.
Does it fit your needs?
Comment #15
dvessel commentedThat's great! I'll give it a thorough workout. Will post back soon. Thanks! :)
Comment #16
dvessel commentedI think you nailed it! Works as expected now. I've been waiting for this and it works beautifully. Inline code character escapes work well too when it's enabled.
Superb job! Really appreciate it. Thanks.
My testing wasn't thorough but I'll be sure to let you if I run into a bug. It will be installed on my main site. :)
Comment #17
pitpit commentedfixed on cvs
Comment #18
(not verified) commented