Skip to content


Subversion checkout URL

You can clone with
Download ZIP


WebComment: better washing of list and links for email #929

jeromecaffaro opened this Issue · 1 comment

1 participant


Originally on 2012-03-02

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>
print washer.wash(b)
1. foo
2. bar

Also when dealing with links:

c = '<a href="http://foo">bar</a>'
print washer.wash(c)

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)

e = '<a href="http://foo">http://bar</a>'
print washer.wash(e)

Fix the handling of such tags and add the above example as unit tests (as well as other unit tests).

@jeromecaffaro jeromecaffaro self-assigned this

Originally on 2012-03-02

Duplicate of #845

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.