Fixed a bug of code block caused by span tags that cross multiple lines.
This patch makes sure all tags are enclosed in every line with the
correct syntax class.