src/cm/converters/abi_converters.py
changeset 456 b2a7c015362b
parent 454 b7a092a52eae
child 457 f62f7f0bcaa4
equal deleted inserted replaced
455:33c7e20efcb7 456:b2a7c015362b
   302           except KeyError:
   302           except KeyError:
   303             p['style'] = 'margin-top: 10pt; margin-bottom: 10pt;';
   303             p['style'] = 'margin-top: 10pt; margin-bottom: 10pt;';
   304 
   304 
   305         # for some reason having DOCTYPE declaration makes soup unhappy
   305         # for some reason having DOCTYPE declaration makes soup unhappy
   306         output = re.sub(r'<!(<!DOCTYPE html[^>]*>)>', r'\1', unicode(soup))
   306         output = re.sub(r'<!(<!DOCTYPE html[^>]*>)>', r'\1', unicode(soup))
       
   307         # And for some reason, & is not converted to &amp; from time to time!
       
   308         output = re.sub(r'&(?![A-Za-z]+[0-9]*;|#[0-9]+;|#x[0-9a-fA-F]+;)', r'&amp;', output)
   307         return output
   309         return output