Ignore:
Timestamp:
6 Jul 2020, 07:48:42 (4 years ago)
Author:
Henrik Bettermann
Message:

Removing newlines is not really useful if we want to use html tags for string formatting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/waeup.kofa/trunk/src/waeup/kofa/browser/pdf.py

    r16061 r16145  
    111111
    112112    Main things fixed here:
     113    - just replace newlines by <br> tags
    113114    If html code:
    114     - remove newlines (not visible in HTML but visible in PDF)
    115115    - add <br> tags after <div> (as divs break lines in HTML but not in PDF)
    116116    - replace <li> tags (as lists are not supported by reportlab)
    117     If not html code:
    118     - just replace newlines by <br> tags
    119     """
     117    """
     118    html = html.replace('\n', '<br />')
    120119    if u'₦' in html:
    121120        html = html.replace(u'₦', u'NGN')
     
    124123        html = html.replace('<li>', '- ')
    125124        html = html.replace('</li>', '<br />')
    126         html = html.replace('\n', '')
    127     else:
    128         html = html.replace('\n', '<br />')
    129125    return html
    130126
Note: See TracChangeset for help on using the changeset viewer.