misc: linkify emails (#78211) #770
|
@ -480,6 +480,11 @@ def test_wysiwygwidget():
|
|||
assert not widget.has_error()
|
||||
assert widget.parse() == '<a>a</a>' # javascript: got filtered
|
||||
|
||||
widget = WysiwygTextWidget('test')
|
||||
mock_form_submission(req, widget, {'test': 'an email address: test@example.net'})
|
||||
assert not widget.has_error()
|
||||
assert widget.parse() == 'an email address: <a href="mailto:test@example.net">test@example.net</a>'
|
||||
|
||||
# check comments are kept
|
||||
widget = WysiwygTextWidget('test')
|
||||
mock_form_submission(req, widget, {'test': '<p>hello</p><!-- world --><p>.</p>'})
|
||||
|
|
|
@ -2552,7 +2552,7 @@ class WysiwygTextWidget(TextWidget):
|
|||
styles=self.ALL_STYLES,
|
||||
strip=True,
|
||||
strip_comments=False,
|
||||
filters=[partial(LinkifyFilter, skip_tags=['pre'], parse_email=False)],
|
||||
filters=[partial(LinkifyFilter, skip_tags=['pre'], parse_email=True)],
|
||||
)
|
||||
self.value = cleaner.clean(self.value)
|
||||
if self.value.startswith('<br />'):
|
||||
|
|
Loading…
Reference in New Issue