(html)
return re.sub('\t +', '\t', re.sub('\n +', '\n', manpage))
Convert HTML to troff.
Convert HTML to troff.
Convert HTML to troff .
def _html_to_man(html):
    """Convert HTML to troff."""
    doc = etree.parse(StringIO(html), etree.HTMLParser(encoding='utf-8'))
    docroot = doc.getroot()
    manpage = '\'\\" t\n.pc\n.TH PCBASIC 1\n' + _convert_element(docroot)
    # replace two starting spaces (not sure where from)
    return re.sub('\t +', '\t', re.sub('\n +', '\n', manpage))
def _html_to_man ( html ) : doc = etree . parse ( StringIO ( html ) , etree . HTMLParser ( encoding = 'utf-8' ) ) docroot = doc . getroot ( ) manpage = '\'\\" t\n.pc\n.TH PCBASIC 1\n' + _convert_element ( docroot ) # replace two starting spaces (not sure where from) return re . sub ( '\t +' , '\t' , re . sub ( '\n +' , '\n' , manpage ) )