You are here

public function GeshiFilterFilter::preparePhpCallback in GeSHi Filter for syntax highlighting 8.2

Same name and namespace in other branches
  1. 8 src/Plugin/Filter/GeshiFilterFilter.php \Drupal\geshifilter\Plugin\Filter\GeshiFilterFilter::preparePhpCallback()

Callback for _geshifilter_prepare for < ?php ... ? > blocks.

Parameters

array $match: An array with the pieces from matched string.

File

src/Plugin/Filter/GeshiFilterFilter.php, line 942

Class

GeshiFilterFilter
Provides a base filter for Geshi Filter.

Namespace

Drupal\geshifilter\Plugin\Filter

Code

public function preparePhpCallback(array $match) {
  if ($this
    ->decodeEntities()) {
    $match[2] = $this
      ->unencode($match[2]);
  }
  return '[geshifilter-questionmarkphp]' . str_replace([
    "\r",
    "\n",
  ], [
    '',
    '&#10;',
  ], Html::escape($match[2])) . '[/geshifilter-questionmarkphp]';
}