You are here

public static function Typogrify::_quote_wrapper in Typogrify 6

Same name and namespace in other branches
  1. 5 typogrify.class.php \Typogrify::_quote_wrapper()
  2. 7 typogrify.class.php \Typogrify::_quote_wrapper()

Helper method for initial_quotes method - used for preg_replace_callback

File

./typogrify.class.php, line 111
typogrify.class.php Defines a class for providing different typographical tweaks to HTML

Class

Typogrify
@file typogrify.class.php Defines a class for providing different typographical tweaks to HTML

Code

public static function _quote_wrapper($matchobj) {
  if (!empty($matchobj[7])) {
    $classname = "dquo";
    $quote = $matchobj[7];
  }
  else {
    $classname = "quo";
    $quote = $matchobj[8];
  }
  return sprintf('%s<span class="%s">%s</span>', $matchobj[1], $classname, $quote);
}