You are here

protected static function SmartyPants::abbrNarrownbsp in Typogrify 8

Wrapping abbreviations adding whitespace '&narrownbsp;'.

Parameters

array $hit: A matcher-array from preg_replace_callback.

Return value

string The first element of the array, wrapped in a span.

File

src/SmartyPants.php, line 878

Class

SmartyPants
SmartyPants - Smart punctuation for web sites.

Namespace

Drupal\typogrify

Code

protected static function abbrNarrownbsp(array $hit) {
  $res = preg_replace('/\\.(\\p{L})/u', '. \\1', $hit[0]);
  return '<span class="abbr">' . $res . '</span>';
}