Abbreviation Plurals

Summary: Automatically format text like CCDs as a plural abbreviation, instead of as a wikiword.
Version:
Prerequisites:
Status:
Maintainer:
Categories: Markup

Questions answered by this recipe

How do I automatically format text like CCDs as a plural abbreviation, instead of as a wikiword?

Description

Enter your recipe's description here.

Notes

The following markup entry will do it:

 Markup("abbr",'>[[',"/\\b([[:upper:]][[:upper:]]+)(s?)/e",
    "'<big><span style=\'font-variant: small-caps\'>'.
      strtolower('$1').'</span></big>'.'$2'");

This formats abbreviations (strings of uppercase characters), including abbreviation plurals, as small caps, slightly larger than normal text. The output you see depends on the browser you use. Not all browsers support the small caps variant.

So while using small caps for abbreviations is good typographical practice, administrators may want to use the simpler alternative, given below.

Alternative

This just stops abbreviation plurals from wikifying:

 Markup("abbr",'>[[',"/`?\\b([[:upper:]][[:upper:]]+s)\\b/e","Keep('$1')");

The opening backtick catches dewikified references and the trailing \\b forces whole words.

See Also

Contributors

jr

Comments

See discussion at AbbreviationPlurals-Talk