You are here

function EducateEllipses in Typogrify 6

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

File

./smartypants.php, line 544
smartypants.php SmartyPants - Smart punctuation for web sites

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 $_;
}