Span tag handling improvement

It is possible, that one "span" tag could have more than one formating class,
so such cases have to be handled properly.