2
0
mirror of https://expo.survex.com/repositories/troggle/.git synced 2024-11-22 15:21:52 +00:00

fix bug in <p> removal

This commit is contained in:
Philip Sargent 2023-10-14 02:05:25 +03:00
parent 5cfc237448
commit 5d383e0445

View File

@ -213,7 +213,8 @@ def logbookedit(request, year=None, slug=None):
entry = request.POST["text"].strip() entry = request.POST["text"].strip()
entry = entry.replace('\r','') # remove HTML-standard CR inserted entry = entry.replace('\r','') # remove HTML-standard CR inserted
entry = entry.replace('\n\n','\n<br />\n<br />\n') # replace 2 \n with <br><br> entry = entry.replace('\n\n','\n<br />\n<br />\n') # replace 2 \n with <br><br>
entry = entry.replace('<p','<br />\n<br') # replace <p> tag, even if it has attributes, with <br><br> entry = entry.replace('<p>','<br />\n<br') # replace <p> tag with <br><br>
entry = entry.replace('<p ','<br />\n<br') # replace <p> tag with attributes with <br><br>
entry = entry.replace('<br>','<br />') # clean up previous hack entry = entry.replace('<br>','<br />') # clean up previous hack
tu = request.POST["tu"].strip() tu = request.POST["tu"].strip()
tu = clean_tu(tu) tu = clean_tu(tu)