Include HTML in theme_pager_next $text variable? Is it possible to include markup in the $text variable of theme_pager_next()? I find that whatever I set the variable to gets output as a string, rather than being rendered as HTML. Here's some example code as would be found in template.php:

    function theme_pager_next($variables){ 
      $text = '&lt;span&gt;test value&lt;/span&gt;';

      /* Remainder of function call goes here ...*/

      return $output;
    }


I would like be able to add an image to the pager text. I realize I could also use CSS background images, but would prefer to print markup to the page if at all  possible.

Is there something I'm overlooking?
If the rest of the code is the same used in theme_pager_next(), then it is not possible to add HTML tags to $text.

This is because theme_pager_next(), and theme_pager_last() call theme_pager_link(). theme_pager_next()'s code is the following one.

if ($page_new[$element] == ($pager_total[$element] - 1)) {
  $output = theme('pager_last', array('text' =&gt; $text, 'element' =&gt; $element, 'parameters' =&gt; $parameters));
}
// The next page is not the last page.
else {
  $output = theme('pager_link', array('text' =&gt; $text, 'page_new' =&gt; $page_new, 'element' =&gt; $element, 'parameters' =&gt; $parameters));
}


theme_pager_link() then contains the following code.

$attributes['href'] = url($_GET['q'], array('query' =&gt; $query));
return '&lt;a' . drupal_attributes($attributes) . '&gt;' . check_plain($text) . '&lt;/a&gt;';


As it calls check_plain(), if $text contains HTML tags, they are shown as plain text. 

To achieve what you are trying to do, you should override theme_pager_link() with a theme function that doesn't call check_plain(). filter_xss() could be a better function to use in this case, but remember to pass in $allowed_tags the list of the tags you want to allow.

As side note, when you want to alter the content of the $variables array a theme function gets, in Drupal 7 you can use its preprocess functions. Every theme function has preprocess functions, and in your theme that is THEME_preprocess_pager_next(). (Replace THEME with the short name of your theme.)