Typography | |
These features are enabled by default but can be toggled on or off from the General Settings tab of the Editing and Plugins control panel if for some reason they aren't appropriate for your site. Typical example: when you use wiki pages as Smarty template resources for PluginTrackerlist and it contains double or single quotes it can break parsing the TPL with a parse error. |
Transforms | |
|
Smart quotes | |
Straight quotes ( Also, inside words written using the Hebrew alphabet, a straight apostrophe or double quote character will become a proper Geresh or Gershayim character. |
Approximative ASCII quotes | |
Note: this option is not enabled by default. Backtick-style quotes (``like this'' ) become “curly” quotes. This also enables approximative guillemets ( < ) and low double quotes using a double comma ( ,,like this`` ).
|
Dashes | |
Double hyphen ( Note that to avoid ambiguity with the strikethrough wiki syntax, double hyphens should have a space on both side. |
Ellipsis | |
Three consecutive dots ( |
Smart spacing | |
You probably won't notice that something is happening with the spaces, but you might notice fewer line breaks happening in awkward places. That is because the typographic prettifier replaces spaces with no-break spaces in some places. A no-break space is visually identical to a regular space, but prevents line breaks from occuring there. The default configuration will never insert or remove a space. It will only replace existing spaces with no-break spaces in the following instances:
|
Avoiding the typographic prettifier | |
|
Monospace & preformated text | |
Most of the time monospace text and preformatted sections are used for code sample. Altering the quotes or the punctuation there would make the code invalid. So monospace text and preformatted sections are left untouched by the typographic prettifier. |
Escapes | |
If you find yourself in a situation where curled quotes or other smart punctuation is not desirable in regular text, you can prefix the punctuation with a backslash character (-+\+-) which will make the typographic prettifier to ignore this character. For instance, when writing about feets and inches you normally should not use curly quotes: He is 5\' 8\" tall.
|
Algorithmic shortcomings | |
The typographic prettifier uses a heuristic that works almost all the time, but there will be some rare cases where it won't curl the quotes the right way. For instance: 'Twas the night before Christmas. Here the typographic prettifier will curl the quote the wrong way — as an opening single quote while in reality it should be an apostrophe indicating the contraction. In cases like this, you will need to insert the correct curly quote manually. |
Configuration | |
You can toggle on or off globally various parts of the typographic prettifier from the Editing and Plugins control panel. |
Advanced per-language configuration | |
You can add a typography.php file in the directory that contains the translation for a particular language. Just rename the typography.php_example file by removing the _example suffix, uncomment the lines where you want to change the defaults and set the appropriate values. In that file, you can specify which smart quote characters to use for this particular language. You can also refine more precisely the spacing rules for each of the cases above: use It is also possible to change the smart space character to use for each punctuation mark independently. So if you want to use a half-space before the colon, you can. Although beware of font and browser support if you use non-mainstream space characters. |
Related links | |