[Pmwiki-users] Demo of smart quotes

John Rankin john.rankin at affinity.co.nz
Thu May 29 19:26:47 CDT 2003


Those interested can look and test at:
http://intranet.affinity.co.nz/tertiary/index.php/Main/WikiSandbox

Suggestions and improvements welcome.

The code is a bit raw, but I can make it available on request after I have =
cleaned it up. Let me know if you would be interested.

It avoids smartening HTML markup by doing

$InlineReplacements["/(<.*?>)|((.?)(['\"]+))/e"] =3D '"$1" . SmartenQuotes(=
"$2")';

It treats ' and " as markup characters, so in theory it can replace them =
with entities other than left and right single and double quotes. =
Languages other than English would just need to change the entity  names.

Usage:
Include in local.php. Most situations just work. To get '90s coming out =
correctly as right quote 90s, enter `'90s (the back tick is removed on =
output).=20

It's clear about its limitations and won't help those who put apostrophes =
where they don't belong...
--=20
John Rankin
Affinity Limited
T 64 4 495 3737
F 64 4 473 7991
021 RANKIN
john.rankin at affinity.co.nz
www.affinity.co.nz/wiki






More information about the pmwiki-users mailing list