function _typogrify_abbr_span in Typogrify 7
Wrapping abbreviations adding whitespace by setting margin-left in a span.
Parameters
array $hit: matcher-array from preg_replace_callback.
1 string reference to '_typogrify_abbr_span'
- typogrify_smart_abbreviation in ./
smartypants.php - Wrapping abbreviations and adding half space between digit grouping.
File
- ./
smartypants.php, line 782 - SmartyPants - Smart punctuation for web sites
Code
function _typogrify_abbr_span($hit) {
$thbl = '.<span style="margin-left:0.167em"><span style="display:none"> </span></span>';
$res = preg_replace('/\\.(\\p{L})/u', $thbl . '\\1', $hit[0]);
return '<span class="abbr">' . $res . '</span>';
}