You are here

function EducateDashesOldSchool in Typogrify 5

Same name and namespace in other branches
  1. 6 smartypants.php \EducateDashesOldSchool()
  2. 7 smartypants.php \EducateDashesOldSchool()
1 call to EducateDashesOldSchool()
SmartyPants in ./smartypants.php
1 string reference to 'EducateDashesOldSchool'
SmartDashes in ./smartypants.php

File

./smartypants.php, line 537

Code

function EducateDashesOldSchool($_) {

  #

  #   Parameter:  String.

  #

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

  #               an en-dash HTML entity, and each "---" translated to

  #               an em-dash HTML entity.

  #

  #                      em         en
  $_ = str_replace(array(
    "---",
    "--",
  ), array(
    '—',
    '–',
  ), $_);
  return $_;
}