Extension:CharRangeSpan

The CharRangeSpan extension wraps characters in specified ranges in customisable span tags. The main use-case for this is to automatically set the font for certain character sets, for sites which have several languages which need different fonts.

Configuration

 * $wgCharRangeSpanSettings: An array containing all of the configuration parameters.
 * $wgCharRangeSpanSettings[Name]: Each set of character ranges can be named anything.
 * $wgCharRangeSpanSettings[Name]['ranges']: Contains arrays containing the unicode codepoints of the start and end of character ranges to match.
 * $wgCharRangeSpanSettings[Name]['attrs']: The attribute to set for the span tag matching the above ranges.
 * $wgCharRangeSpanSettings[Name]['maybeChars']: Characters which may be included in span, or may not. Each character must be escaped for a PHP regular expression (see the example below). This is useful to avoid ending and starting span tags for common characters for which the font is unimportant, for example spaces and commas.

Example configuration
This is the default configuration. It defines one set of character ranges (Greek), and encloses any such characters in tags.

Testing
This extension has some unit tests. To run them first install the extension, then from the command line (in the mediawiki directory) run this command: Note that the tests rely on the default configuration.