You are here

protected static function SmartyPants::educateBackticks in Typogrify 8

Educate backticks.

Example input: ``Isn't this fun?'' Example output: “Isn't this fun?”.

Parameters

string $_: Input text.

Return value

string The string, with ``backticks'' -style double quotes translated into HTML curly quote entities.

2 calls to SmartyPants::educateBackticks()
SmartyPants::process in src/SmartyPants.php
SmartyPants.
SmartyPants::smartQuotes in src/SmartyPants.php
SmartQuotes.

File

src/SmartyPants.php, line 1054

Class

SmartyPants
SmartyPants - Smart punctuation for web sites.

Namespace

Drupal\typogrify

Code

protected static function educateBackticks($_) {
  $_ = str_replace([
    "``",
    "''",
    ",,",
  ], [
    '“',
    '”',
    '„',
  ], $_);
  return $_;
}