Changeset 3047


Ignore:
Timestamp:
Jan 3, 2013, 9:17:20 PM (8 years ago)
Author:
nosdeputes
Message:

fix breaklines surprises de l'an

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpc/trunk/project/batch/questions/parse.py

    r2997 r3047  
    4848
    4949lastbr_re = re.compile('\s*<br\s*/?>$', re.U|re.M)
     50linebreaks_re = re.compile(r'[\s\r\n]+')
    5051def extracttext(t):
    5152    div = t.parent.findNextSibling('div', attrs={'class': 'contenutexte'})
    5253    text = div.decodeContents().strip()
    53     return lastbr_re.sub('', text)
     54    return linebreaks_re.sub(' ', lastbr_re.sub('', text))
    5455
    5556def extractspan(t):
Note: See TracChangeset for help on using the changeset viewer.