You are here

public static function SmartyPants::processEscapes in Typogrify 8

Process escapes.

Escape Value ------ ----- \\ \ \" " \' ' \. . \- - \` ` \, ,

Parameters

string $_: Input text.

Return value

string The string, with after processing the following backslash escape sequences. This is useful if you want to force a "dumb" quote or other character to appear.

5 calls to SmartyPants::processEscapes()
SmartyPants::process in src/SmartyPants.php
SmartyPants.
SmartyPants::smartDashes in src/SmartyPants.php
SmartDashes.
SmartyPants::smartEllipses in src/SmartyPants.php
SmartEllipses.
SmartyPants::smartQuotes in src/SmartyPants.php
SmartQuotes.
UnicodeConversion::convertCharacters in src/UnicodeConversion.php
Perform character conversion.

File

src/SmartyPants.php, line 1203

Class

SmartyPants
SmartyPants - Smart punctuation for web sites.

Namespace

Drupal\typogrify

Code

public static function processEscapes($_) {
  $_ = str_replace([
    '\\\\',
    '\\"',
    "\\'",
    '\\.',
    '\\-',
    '\\`',
    '\\,',
    '<',
    '>',
    '&quot;',
    '&#039;',
  ], [
    '&#92;',
    '&#34;',
    '&#39;',
    '&#46;',
    '&#45;',
    '&#96;',
    '&#x2c;',
    '&lt;',
    '&gt;',
    '"',
    '\'',
  ], $_);
  return $_;
}