function styleTemplate(settings) {
    return "<span class='" + settings.style + "'>" + settings.text + "</span>";
}
MIRC compliant colour and style parser
Unfortuanately this is a non trivial operation
See this branch for source and tests
https://github.com/megawac/irc-style-parser/tree/shout