Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

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

Closed
jeromecaffaro opened this Issue · 1 comment

1 participant

@jeromecaffaro
Collaborator

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>
<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:

<http://foo>(bar)

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).

@jeromecaffaro jeromecaffaro self-assigned this
@jeromecaffaro
Collaborator

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.