You are here

public static function Typogrify::quoteWrapper in Typogrify 8

Helper method for initialQuotes method - used for preg_replace_callback.

File

src/Typogrify.php, line 121

Class

Typogrify
Class \Drupal\typogrify\Typogrify.

Namespace

Drupal\typogrify

Code

public static function quoteWrapper($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);
}