Could you fix so that it doesn't change the existing links?
--
Ticket URL: <https://code.djangoproject.com/ticket/25157>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
* needs_better_patch: => 0
* needs_tests: => 0
* needs_docs: => 0
Old description:
> urlizetrunc in 1.7x is used to not modify existing link. E.g. ```'foo<a
> href=" google.com ">bar</a>buz'``` remains unchanged. In 1.8x it changes
> to something like: ```'foo<a href=" <a href="http://google.com"
> rel="nofollow">google.com</a> ">bar</a>buz'```
> (https://github.com/django/django/blob/master/tests/template_tests/filter_tests/test_urlizetrunc.py)
>
> Could you fix so that it doesn't change the existing links?
New description:
urlizetrunc in 1.7x is used to not modify existing link. E.g. {{{'foo<a
href=" google.com ">bar</a>buz'}}} remains unchanged. In 1.8x it changes
to something like: {{{'foo<a href=" <a href="http://google.com"
rel="nofollow">google.com</a> ">bar</a>buz'}}}
(https://github.com/django/django/blob/master/tests/template_tests/filter_tests/test_urlizetrunc.py)
Could you fix so that it doesn't change the existing links?
--
--
Ticket URL: <https://code.djangoproject.com/ticket/25157#comment:1>
Comment (by dexity):
I think the problem is with {{{simple_url_2_re}}} in Django 1.8.
{{{re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)($|/.*)$',
re.IGNORECASE)}}}
In Django 1.7 it was
{{{re.compile(r'^www\.|^(?!http)\w[^@]+\.(com|edu|gov|int|mil|net|org)$',
re.IGNORECASE)}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/25157#comment:2>
Comment (by dexity):
I mock patched {{{simple_url_2_re}}} from Django 1.7 and it works as
expected (existing link doesn't change).
--
Ticket URL: <https://code.djangoproject.com/ticket/25157#comment:3>
* status: new => closed
* resolution: => wontfix
Comment:
Sorry for the regression, but
[https://docs.djangoproject.com/en/1.8/ref/templates/builtins/#urlizetrunc
the documentation says], "As with urlize, this filter should only be
applied to plain text."
--
Ticket URL: <https://code.djangoproject.com/ticket/25157#comment:4>