Changeset 16149


Ignore:
Timestamp:
7 Jul 2020, 20:29:27 (4 years ago)
Author:
Henrik Bettermann
Message:

Employ a trick to use links in pdf files whereby the source is pure text.

File:
1 edited

Legend:

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

    r16148 r16149  
    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
     118    The link tag must not be used in html coded text. Use a tags instead.
     119
    117120    If not html code:
    118121    - just replace newlines by <br> tags
     
    120123    if u'₦' in html:
    121124        html = html.replace(u'₦', u'NGN')
    122     if '</' in html:
     125    if '</' in html and not '</link' in html:
    123126        html = html.replace('</div>', '</div><br />')
    124127        html = html.replace('<li>', '- ')
Note: See TracChangeset for help on using the changeset viewer.