You are here

public function GeshiFilterFilter::unencode in GeSHi Filter for syntax highlighting 8

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

Return the string with some html entities unencoded.

Text editors like ckeditor encodes some strings, like " to &amp&quote;, we must undo this on code passed to geshifilter.

Parameters

string $text: The original text.

Return value

string The text unencoded.

3 calls to GeshiFilterFilter::unencode()
GeshiFilterFilter::prepareCallback in src/Plugin/Filter/GeshiFilterFilter.php
Callback_geshifilter_prepare for preparing input text.
GeshiFilterFilter::prepareMarkdownCallback in src/Plugin/Filter/GeshiFilterFilter.php
Callback for preparing input text from markdown(```) tags.
GeshiFilterFilter::preparePhpCallback in src/Plugin/Filter/GeshiFilterFilter.php
Callback for _geshifilter_prepare for < ?php ... ? > blocks.

File

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

Class

GeshiFilterFilter
Provides a base filter for Geshi Filter.

Namespace

Drupal\geshifilter\Plugin\Filter

Code

public function unencode($text) {
  $text = html_entity_decode($text, ENT_QUOTES);
  return $text;
}