You are here

function EducateEllipses in Typogrify 5

Same name and namespace in other branches
  1. 6 smartypants.php \EducateEllipses()
  2. 7 smartypants.php \EducateEllipses()
2 calls to EducateEllipses()
SmartEllipses in ./smartypants.php
SmartyPants in ./smartypants.php

File

./smartypants.php, line 576

Code

function EducateEllipses($_) {

  #

  #   Parameter:  String.

  #   Returns:    The string, with each instance of "..." translated to

  #               an ellipsis HTML entity. Also converts the case where

  #               there are spaces between the dots.

  #

  #   Example input:  Huh...?

  #   Example output: Huh…?

  #
  $_ = str_replace(array(
    "...",
    ". . .",
  ), '…', $_);
  return $_;
}