WebComment: better washing of list and links for email
|Reported by:||jcaffaro||Owned by:||jcaffaro|
Ticket #764 was trying to introduce nicer handling of lists and links markup in email notifications but some issues remain (or have been introduced).
For example when processing a list, one gets:
from invenio.webcomment_washer import * washer = EmailWasher() a = '<ol><li>foo</li><li>bar</li></ol>' print washer.wash(a) 1. foo2. bar
while we would expect the following output:
1. foo 2. bar
It works however if '\n' are already inserted into the source string:
b = '''<ol><li>foo</li> <li>bar</li></ol>''' print washer.wash(b) 1. foo 2. bar
Also when dealing with links:
c = '<a href="http://foo">bar</a>' print washer.wash(c) <http://foo>bar
we would expect instead the following output:
It works however nicely when the the link label is identified as a URL:
d = '<a href="http://foo">http://foo</a>' print washer.wash(d) <http://foo> e = '<a href="http://foo">http://bar</a>' print washer.wash(e) <http://foo>(http://bar)
Fix the handling of such tags and add the above example as unit tests (as well as other unit tests).