CurlyQuotes

Summary: Display Curly Double/Single Quotes and M/N Dashes
Version:
Prerequisites: known to work in PmWiki 2.1
Status:
Maintainer:
Discussion: CurlyQuotes-Talk
Categories: Markup

Questions answered by this recipe

How can I turn straight quotes into curly quotes when a page is displayed, without interfering with other markup that involves quotes? How can I create m- and n-dashes with simple wiki markup?

Description

Add the following to your config.php:

if ($action != 'edit') {
 # make curly quotes 
 Markup("\"",'_end',"/\"(.*?)\"/",'“$1”');
 # make m-dash 
 Markup("---",'_end',"/---([^-])/",'—$1');
 # make n-dash 
 Markup("--",'_end',"/--([^->])/",'–$1'); 
 # curly single quote in contraction
 Markup("a'a",'_end',"/([A-Za-z])'([A-Za-z][A-Za-z]?[^A-Za-z])/",'$1’$2');
}

Notes

Release Notes

If the recipe has multiple releases, then release notes can be placed here. Note that it's often easier for people to work with "release dates" instead of "version numbers".

See Also

Contributors

John Cooley, Ben Stallings

Comments

See discussion at CurlyQuotes-Talk