def convert_basic(txt, title='', epub_split_size_kb=0):
 txt = clean_txt(txt)
 txt = split_txt(txt, epub_split_size_kb)
 lines = []
 blank_count = 0
 for line in txt.split('\n'):
  if line.strip():
   blank_count = 0
   lines.append((u'<p>%s</p>' % prepare_string_for_xml(line.replace('\n', ' '))))
  else:
   blank_count += 1
   if (blank_count == 2):
    lines.append(u'<p>&nbsp;</p>')
 return (HTML_TEMPLATE % (title, u'\n'.join(lines)))

def convert_basic ( txt , title = '' , epub_split_size_kb = 0 ) : txt = clean_txt ( txt ) txt = split_txt ( txt , epub_split_size_kb ) lines = [ ] blank_count = 0 for line in txt . split ( '\n' ) : if line . strip ( ) : blank_count = 0 lines . append ( ( u'<p>%s</p>' % prepare_string_for_xml ( line . replace ( '\n' , ' ' ) ) ) ) else : blank_count += 1 if ( blank_count == 2 ) : lines . append ( u'<p>&nbsp;</p>' ) return ( HTML_TEMPLATE % ( title , u'\n' . join ( lines ) ) )
converts plain text to html by putting all paragraphs in <p> tags .