diff --git a/codefilter.test b/codefilter.test
index 71d18c1..fa2374d 100644
--- a/codefilter.test
+++ b/codefilter.test
@@ -61,6 +61,11 @@ class CodeFilterUnitTestCase extends DrupalUnitTestCase {
     $expected = file_get_contents($this->path . '/codefilter.php-output.txt');
     $result = $this->filterText($input);
     $this->assertIdentical($expected, $result);
+
+    $input = file_get_contents($this->path . '/codefilter.php-input-2.txt');
+    $expected = file_get_contents($this->path . '/codefilter.php-output-2.txt');
+    $result = $this->filterText($input);
+    $this->assertIdentical($expected, $result);
   }
 
   /**
diff --git a/modules/codefilter_prism/codefilter_prism.module b/modules/codefilter_prism/codefilter_prism.module
index 49bc8c5..d9328e2 100644
--- a/modules/codefilter_prism/codefilter_prism.module
+++ b/modules/codefilter_prism/codefilter_prism.module
@@ -117,8 +117,6 @@ function codefilter_prism_process_code($text, $attributes = '') {
   // Trim first leading line break.
   $text = preg_replace('@^[ \t]*[\n]@', '', $text);
 
-  $text = decode_entities($text);
-
   // Add language class if one doesn't exist.
   if (strpos($attributes, 'class="') !== FALSE) {
     if (strpos($attributes, 'language-') === FALSE) {
diff --git a/modules/codefilter_prism/codefilter_prism.test b/modules/codefilter_prism/codefilter_prism.test
index 6e2aaf6..94ef0d4 100644
--- a/modules/codefilter_prism/codefilter_prism.test
+++ b/modules/codefilter_prism/codefilter_prism.test
@@ -77,6 +77,11 @@ class CodeFilterPrismUnitTestCase extends DrupalUnitTestCase {
     $expected = file_get_contents($this->path . '/php-output.txt');
     $result = $this->filterText($input);
     $this->assertIdentical($expected, $result);
+
+    $input = file_get_contents($this->path . '/php-input-2.txt');
+    $expected = file_get_contents($this->path . '/php-output-2.txt');
+    $result = $this->filterText($input);
+    $this->assertIdentical($expected, $result);
   }
 
   /**
diff --git a/modules/codefilter_prism/tests/php-input-2.txt b/modules/codefilter_prism/tests/php-input-2.txt
new file mode 100644
index 0000000..b972a14
--- /dev/null
+++ b/modules/codefilter_prism/tests/php-input-2.txt
@@ -0,0 +1,8 @@
+<?php
+/**
+ * Callback to escape content of <?php ?>, [?php ?], <% %>, and [% %] elements.
+ */
+function _codefilter_prism_escape_php_tag_callback($matches) {
+  return codefilter_prism_escape($matches[2], 'php');
+}
+?>
diff --git a/modules/codefilter_prism/tests/php-output-2.txt b/modules/codefilter_prism/tests/php-output-2.txt
new file mode 100644
index 0000000..28eb739
--- /dev/null
+++ b/modules/codefilter_prism/tests/php-output-2.txt
@@ -0,0 +1,7 @@
+<pre class="codeblock"><code class="language-php">/**
+ * Callback to escape content of <?php ?>, [?php ?], <% %>, and [% %] elements.
+ */
+function _codefilter_prism_escape_php_tag_callback($matches) {
+  return codefilter_prism_escape($matches[2], 'php');
+}
+</code></pre>
diff --git a/tests/code-input.txt b/tests/code-input.txt
deleted file mode 100644
index 76a3f16..0000000
--- a/tests/code-input.txt
+++ /dev/null
@@ -1,10 +0,0 @@
-<code>
-// Code comment is here.
-watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO);
-
-/**
- * Longer comment is here.
- **/
-
-
-</code>
diff --git a/tests/code-output.txt b/tests/code-output.txt
deleted file mode 100644
index 1905262..0000000
--- a/tests/code-output.txt
+++ /dev/null
@@ -1,9 +0,0 @@
-<pre class="codeblock"><code class="language-php">// Code comment is here.
-watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO);
-
-/**
- * Longer comment is here.
- **/
-
-
-</code></pre>
diff --git a/tests/codefilter.php-input-2.txt b/tests/codefilter.php-input-2.txt
new file mode 100644
index 0000000..b972a14
--- /dev/null
+++ b/tests/codefilter.php-input-2.txt
@@ -0,0 +1,8 @@
+<?php
+/**
+ * Callback to escape content of <?php ?>, [?php ?], <% %>, and [% %] elements.
+ */
+function _codefilter_prism_escape_php_tag_callback($matches) {
+  return codefilter_prism_escape($matches[2], 'php');
+}
+?>
diff --git a/tests/codefilter.php-output-2.txt b/tests/codefilter.php-output-2.txt
new file mode 100644
index 0000000..ca2f5e6
--- /dev/null
+++ b/tests/codefilter.php-output-2.txt
@@ -0,0 +1,9 @@
+<pre class="codeblock"><code class="language-php">
+/**
+ * Callback to escape content of <?php ?>, [?php ?], <% %>, and [% %] elements.
+ */
+function _codefilter_prism_escape_php_tag_callback($matches) {
+  return codefilter_prism_escape($matches[2], 'php');
+}
+?>
+</code></pre>
diff --git a/tests/inline-input.txt b/tests/inline-input.txt
deleted file mode 100644
index f40d9ed..0000000
--- a/tests/inline-input.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Inline <?php $test = TRUE ?> text for PHP
-Inline <code> $test = TRUE </code> text for code
-Inline <code class="language-css">.test { color: red; }</code> text for CSS code
diff --git a/tests/inline-output.txt b/tests/inline-output.txt
deleted file mode 100644
index 506b230..0000000
--- a/tests/inline-output.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-Inline <code class="language-php"> $test = TRUE </code> text for PHP
-Inline <code class="language-php"> $test = TRUE </code> text for code
-Inline <code class="language-css">.test { color: red; }</code> text for CSS code
diff --git a/tests/php-input.txt b/tests/php-input.txt
deleted file mode 100644
index 8bff2c7..0000000
--- a/tests/php-input.txt
+++ /dev/null
@@ -1,8 +0,0 @@
-<?php
-// PHP comment is here.
-watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO);
-
-/**
- * Longer comment is here.
- */
-?>
diff --git a/tests/php-output.txt b/tests/php-output.txt
deleted file mode 100644
index 8d4c0ed..0000000
--- a/tests/php-output.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-<pre class="codeblock"><code class="language-php">// PHP comment is here.
-watchdog('actions', '@count orphaned actions (%orphans) exist in the actions table. !link', array('@count' => $count, '%orphans' => $orphans, '!link' => $link), WATCHDOG_INFO);
-
-/**
- * Longer comment is here.
- */
-</code></pre>
