diff --git a/modules/codefilter_prism/codefilter_prism.module b/modules/codefilter_prism/codefilter_prism.module
index a56fc7a..c5b0fa8 100644
--- a/modules/codefilter_prism/codefilter_prism.module
+++ b/modules/codefilter_prism/codefilter_prism.module
@@ -72,8 +72,6 @@ function codefilter_prism_process_php($text) {
   // Inline or block level piece?
   $multiline = strpos($text, "\n") !== FALSE;
 
-  // Undo the escaping in the prepare step.
-  $text = decode_entities($text);
   // Trim first leading line break.
   $text = preg_replace('@^[ \t]*[\n]@', '', $text);
   $text = codefilter_fix_spaces($text);
diff --git a/modules/codefilter_prism/codefilter_prism.test b/modules/codefilter_prism/codefilter_prism.test
index 54a27f8..1077644 100644
--- a/modules/codefilter_prism/codefilter_prism.test
+++ b/modules/codefilter_prism/codefilter_prism.test
@@ -55,11 +55,13 @@ class CodeFilterPrismUnitTestCase extends DrupalUnitTestCase {
    *
    * @param string $text
    *   The text to filter.
+   * @param array $settings
+   *   Additional settings.
    *
    * @return string
    *   The processed text.
    */
-  protected function filterText($text, $settings = array()) {
+  protected function filterText($text, array $settings = array()) {
     $filter =& $this->filter['codefilter'];
     // Set up a dummy format using defaults.
     $format = new stdClass();
@@ -79,6 +81,23 @@ class CodeFilterPrismUnitTestCase extends DrupalUnitTestCase {
     $this->assertIdentical($expected, $result);
   }
 
+  /**
+   * Checks that <?php tags are escaped and highlighted correctly with markup.
+   */
+  public function testPhpFilterWithMarkup() {
+    $input = <<<EOD
+<?php
+return '<p>' . \$result . '</p>';
+?>
+EOD;
+    $expected = <<<EOD
+<pre class="codeblock"><code class="language-php">return &#039;&lt;p&gt;&#039; . \$result . &#039;&lt;/p&gt;&#039;;
+</code></pre>
+EOD;
+    $result = $this->filterText($input);
+    $this->assertIdentical($expected, $result);
+  }
+
   /**
    * Checks that <code> tags are escaped and highlighted correctly.
    */
diff --git a/modules/codefilter_prism/tests/php-output.txt b/modules/codefilter_prism/tests/php-output.txt
index 8d4c0ed..b37dad3 100644
--- a/modules/codefilter_prism/tests/php-output.txt
+++ b/modules/codefilter_prism/tests/php-output.txt
@@ -1,5 +1,5 @@
 <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);
+watchdog(&#039;actions&#039;, &#039;@count orphaned actions (%orphans) exist in the actions table. !link&#039;, array(&#039;@count&#039; =&gt; $count, &#039;%orphans&#039; =&gt; $orphans, &#039;!link&#039; =&gt; $link), WATCHDOG_INFO);
 
 /**
  * Longer comment is here.
