You are here

function ProcessEscapes in Typogrify 7

Same name and namespace in other branches
  1. 5 smartypants.php \ProcessEscapes()
  2. 6 smartypants.php \ProcessEscapes()

EducateDashesOldSchool.

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 ProcessEscapes()
convert_characters in ./unicode-conversion.php
Perform character conversion.
SmartDashes in ./smartypants.php
SmartDashes.
SmartEllipses in ./smartypants.php
SmartEllipses.
SmartQuotes in ./smartypants.php
SmartQuotes
SmartyPants in ./smartypants.php
SmartyPants.

File

./smartypants.php, line 1086
SmartyPants - Smart punctuation for web sites

Code

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