I installed and enabled the module. After some simple configuration on text format.
I simply wrote

<?php

print "hello world";
?>

but it shown me as a single line and without syntax highlighting

Comments

adrianmak’s picture

StatusFileSize
new13.25 KB

Result page.

Didn't I miss some other settings ?

mlncn’s picture

Component: Miscellaneous » Code
Priority: Normal » Major
Status: Active » Needs review

Same thing happening here, whether i put it before or after the line break filter. I was in the process of moving this to a bug report since it is reported twice and major since it's a primary function of the module... and then i figured out what i was doing wrong. So here's a "major" support request that needs review ;-)

Solution

  1. Go to Administration » Configuration » Content authoring » Text formats (admin/config/content/formats) and most likely the Filtered HTML format.
  2. Under Filter processing order, put your "Limit allowed HTML tags" filter first (or at least before "Code filter").

Have whatever else you'll have in the order you please; in my case "Convert line breaks into HTML", "Convert URLs into links", and "Correct faulty and chopped off HTML" all follow "Code filter", but i don't think it matters as long as "Limit allowed HTML tags" comes before it. The problem is the HTML filter strips out the HTML the code filter adds. Works great now! adrianmark, does that work for you?

osox’s picture

Priority: Major » Minor
Status: Needs review » Fixed

Thank you! This help should go straight to README.txt file.

Status: Fixed » Closed (fixed)

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

adrianmak’s picture

StatusFileSize
new40.54 KB

It's still not work for me

designcontext’s picture

same for me.
Ok, it works only when I turn of Wysiwyg... is there a chance to get it work with Ckeditor?

fehin’s picture

Didn't work for me either. The codeblock div only seems to show up when <?php is used but not with .

fehin’s picture

Status: Closed (fixed) » Active
cameron tod’s picture

Fehin, are you having an issue with WYSIWYG support, or with parsing of <code> tags? Or is it something else?

fehin’s picture

I don't use a WYSIWYG, just regular text fields. The code is displayed in regular text no highlight.

Also does this work with views rewrite field? I tried it and the html was excuted instead of displaying the code.