mirror of
https://github.com/WordPress/WordPress.git
synced 2024-12-23 01:27:36 +01:00
Texturize fix.
git-svn-id: http://svn.automattic.com/wordpress/trunk@1592 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
4fc38fb36d
commit
da9e7308b7
@ -12,8 +12,9 @@ function wptexturize($text) {
|
|||||||
|
|
||||||
if (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag
|
if (isset($curl{0}) && '<' != $curl{0} && $next) { // If it's not a tag
|
||||||
$curl = str_replace('---', '—', $curl);
|
$curl = str_replace('---', '—', $curl);
|
||||||
|
$curl = preg_replace('/(\s)--(\s)/', '$1—$2', $curl);
|
||||||
$curl = str_replace('--', '–', $curl);
|
$curl = str_replace('--', '–', $curl);
|
||||||
$curl = str_replace("...", '…', $curl);
|
$curl = str_replace('...', '…', $curl);
|
||||||
$curl = str_replace('``', '“', $curl);
|
$curl = str_replace('``', '“', $curl);
|
||||||
|
|
||||||
// This is a hack, look at this more later. It works pretty well though.
|
// This is a hack, look at this more later. It works pretty well though.
|
||||||
@ -28,11 +29,11 @@ function wptexturize($text) {
|
|||||||
$curl = preg_replace("/(\d+)'/", '$1′', $curl);
|
$curl = preg_replace("/(\d+)'/", '$1′', $curl);
|
||||||
$curl = preg_replace("/(\S)'([^'\s])/", "$1’$2", $curl);
|
$curl = preg_replace("/(\S)'([^'\s])/", "$1’$2", $curl);
|
||||||
$curl = preg_replace('/(\s|\A)"(?!\s)/', '$1“$2', $curl);
|
$curl = preg_replace('/(\s|\A)"(?!\s)/', '$1“$2', $curl);
|
||||||
$curl = preg_replace('/"(\s|\Z)/', '”$1', $curl);
|
$curl = preg_replace('/"(\s|\S|\Z)/', '”$1', $curl);
|
||||||
$curl = preg_replace("/'([\s.]|\Z)/", '’$1', $curl);
|
$curl = preg_replace("/'([\s.]|\Z)/", '’$1', $curl);
|
||||||
$curl = preg_replace("/\(tm\)/i", '™', $curl);
|
$curl = preg_replace("/ \(tm\)/i", ' ™', $curl);
|
||||||
$curl = preg_replace("/\(c\)/i", '©', $curl);
|
$curl = preg_replace("/ \(c\)/i", ' ©', $curl);
|
||||||
$curl = preg_replace("/\(r\)/i", '®', $curl);
|
$curl = preg_replace("/ \(r\)/i", ' ®', $curl);
|
||||||
$curl = str_replace("''", '”', $curl);
|
$curl = str_replace("''", '”', $curl);
|
||||||
|
|
||||||
$curl = preg_replace('/(d+)x(\d+)/', "$1×$2", $curl);
|
$curl = preg_replace('/(d+)x(\d+)/', "$1×$2", $curl);
|
||||||
|
Loading…
Reference in New Issue
Block a user