php filter incompatible with codefilter

JohnAlbin - January 16, 2008 - 23:59
Project:Code Filter
Version:5.x-1.x-dev
Component:Code
Category:bug report
Priority:normal
Assigned:Unassigned
Status:active
Description

Discovered by Ryan in: http://drupal.org/node/190751#comment-694290

If you are using the php filter, codefilter will style the <?php ?> code blocks and won’t let php filter execute the php code in that block.

The reason for this is that codefilter uses the input filtering 'prepare' operation to convert <?php ?> blocks into [codefilter-php] blocks. While this prevents html filter from improperly styling the code, it also prevents php filter from executing the php.

Codefilter already has support for [?php ?] blocks that will get syntax highlighting. So we just have to figure out how to get php filter to execute the <?php ?> before the input filtering 'prepare' operation.

#1

NancyDru - January 17, 2008 - 16:05

I'm having this problem too. If I change the input format to PHP everything is correct, but then there is no codefilter in that format.

#2

Chill35 - May 24, 2008 - 23:14

Subscribing.

I'd really like for this to work.

#8

NancyDru - May 27, 2008 - 13:07
Priority:normal» minor

Spam posting will get you nowhere Extra posts were deleted.

#9

Chill35 - May 27, 2008 - 15:51

Spam will get me nowhere, hein? (what a let down).

One cannot delete one's posts here. My posts were 'damaged' by use of brackets with keyword 'php'. Like John said, they are implemented -- there is filtering done using brackets with 'php' -- although it's not documented. I simply cleared my posts since I could not delete them. I also submitted a patch, which, essentially, moved the 'prepare' stage code to a later stage, it fixed the problem at hand but broke other things. I recommend using the geshi module, Nancy, if you want to put php code in your nodes and still be able to provide code highlighting. It works with that other module.

#10

NancyDru - May 27, 2008 - 18:31
Priority:minor» normal

Ah, but I believe Geshi has problems with Glossary, which I maintain.

Sorry about the spam stuff. That's what it looked like to me. The webmasters got them deleted.

#11

Frank Steiner - December 12, 2008 - 08:16

Aehm, I don't really get why this is to problematic to solve: if the code filter module supports [?php ?] for styling php code, isn't that enough? Can't we just ignore the <?php ..?> tags then?

#12

Chill35 - December 12, 2008 - 18:12

I recommend using <php></php> for code highlighting.

#13

Chill35 - December 12, 2008 - 18:15

Of course, it's vain to wish for that. All previously submitted content would have to be updated.

I have moved away from Code Filter on my own site and married the geshi module.

#14

Frank Steiner - December 12, 2008 - 22:14

Oh, of course...

So what about a configurable option to let the admin chose if php tags should be captured or not? That would at least allow new sites to turn of the php tags.

 
 

Drupal is a registered trademark of Dries Buytaert.