src/cm/converters/pandoc_converters.py
changeset 517 e7bc083fa9dc
parent 459 a69421197502
equal deleted inserted replaced
516:c6105d922ac6 517:e7bc083fa9dc
   219                 
   219                 
   220     # do not use pandoc to convert from html to html
   220     # do not use pandoc to convert from html to html
   221     if from_format==to_format=='html':
   221     if from_format==to_format=='html':
   222       # get body content
   222       # get body content
   223       stdoutdata = (content.encode('utf8'))
   223       stdoutdata = (content.encode('utf8'))
   224       soup = BeautifulSoup(stdoutdata)
   224       soup = BeautifulSoup(stdoutdata, fromEncoding='UTF-8')
   225       body = soup.body
   225       body = soup.body
   226       if body:
   226       if body:
   227         stdoutdata = body.renderContents()
   227         stdoutdata = body.renderContents()
   228       # strip leading spaces
   228       # strip leading spaces
   229       stdoutdata = re.sub(r"^\s+", '', stdoutdata)
   229       stdoutdata = re.sub(r"^\s+", '', stdoutdata)