You are here

protected static function SmartyPants::educateEllipses in Typogrify 8

EducateEllipses.

Example input: Huh...? Example output: Huh…?

Parameters

string $_: Input text.

Return value

string The string, with each instance of "..." translated to an ellipsis HTML entity. Also converts the case where there are spaces between the dots.

2 calls to SmartyPants::educateEllipses()
SmartyPants::process in src/SmartyPants.php
SmartyPants.
SmartyPants::smartEllipses in src/SmartyPants.php
SmartEllipses.

File

src/SmartyPants.php, line 1148

Class

SmartyPants
SmartyPants - Smart punctuation for web sites.

Namespace

Drupal\typogrify

Code

protected static function educateEllipses($_) {
  $_ = str_replace([
    "...",
    ". . .",
  ], '…', $_);
  return $_;
}