'Just format the tokens, without any wrapping tags.
Yield individual lines.'

def _format_lines(self, tokensource):

    nocls = self.noclasses
    lsep = self.lineseparator
    getcls = self.ttype2class.get
    c2s = self.class2style
    lspan = ''
    line = ''
    for (ttype, value) in tokensource:
        if nocls:
            cclass = getcls(ttype)
            while (cclass is None):
                ttype = ttype.parent
                cclass = getcls(ttype)
            cspan = ((cclass and ('<span    style="%s">' % c2s[cclass][0])) or '')
        else:
            cls = self._get_css_class(ttype)
            cspan = ((cls and ('<span    class="%s">' % cls)) or '')
        parts = escape_html(value).split('\n')
        for part in parts[:(-1)]:
            if line:
                if (lspan != cspan):
                    line += (((((lspan and '</span>') + cspan) + part) + (cspan and '</span>')) + lsep)
                else:
                    line += ((part + (lspan and '</span>')) + lsep)
                (yield (1, line))
                line = ''
            elif part:
                (yield (1, (((cspan + part) + (cspan and '</span>')) + lsep)))
            else:
                (yield (1, lsep))
        if (line and parts[(-1)]):
            if (lspan != cspan):
                line += (((lspan and '</span>') + cspan) + parts[(-1)])
                lspan = cspan
            else:
                line += parts[(-1)]
        elif parts[(-1)]:
            line = (cspan + parts[(-1)])
            lspan = cspan
    if line:
        (yield (1, ((line + (lspan and '</span>')) + lsep)))
