def _key_split(matchobj):
 keys = [k.strip() for k in matchobj.group(1).split('+')]
 return ' + '.join([('<span class="key">%s</span>' % key) for key in keys])

def _key_split ( matchobj ) : keys = [ k . strip ( ) for k in matchobj . group ( 1 ) . split ( '+' ) ] return ' + ' . join ( [ ( '<span class="key">%s</span>' % key ) for key in keys ] )
expands a {key a+b+c} syntax into <span class="key">a</span> + .