You are here

function EducateDashesOldSchool in Typogrify 7

Same name and namespace in other branches
  1. 5 smartypants.php \EducateDashesOldSchool()
  2. 6 smartypants.php \EducateDashesOldSchool()

EducateDashesOldSchool.

Parameters

string $_: Input text.

Return value

string The string, with each instance of "--" translated to an en-dash HTML entity, and each "---" translated to an em-dash HTML entity.

1 call to EducateDashesOldSchool()
SmartyPants in ./smartypants.php
SmartyPants.
1 string reference to 'EducateDashesOldSchool'
SmartDashes in ./smartypants.php
SmartDashes.

File

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

Code

function EducateDashesOldSchool($_) {
  $_ = str_replace(array(
    "---",
    "--",
  ), array(
    '—',
    '–',
  ), $_);
  return $_;
}