Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Linky filter breaks with URLs enclosed in [" and "] #9256

Closed
lorenzhs opened this issue Sep 24, 2014 · 4 comments
Closed

Linky filter breaks with URLs enclosed in [" and "] #9256

lorenzhs opened this issue Sep 24, 2014 · 4 comments

Comments

@lorenzhs
Copy link

Minimal example:

$filter('linky')('["http://foo"]');

This yields Error: [$sanitize:badparse] http://errors.angularjs.org/1.3.0-rc.3/$sanitize/badparse?p0=%3Ca%20href%3D%22http%3A%2F%2Ffoo%22%5D%22%3Ehttp%3A%2F%2Ffoo%26%2334%3B%5D%3C%2Fa%3E

Using 1.3.0-rc3. This is somewhat related to #8945 but a9d2271 does not fix the entire problem as suggested by #8945 (comment)

@lgalfaso
Copy link
Contributor

does #8964 fix this case too? (not specifically the definition of the URL, but the error)

@lorenzhs
Copy link
Author

It does, but the resulting linkification is incorrect (it's "[http://foo"] instead of ["http://foo"], but that definitely is the lesser evil

@lgalfaso
Copy link
Contributor

thanks for the info

@petebacondarwin
Copy link
Contributor

We should improve the linky URL regex to ensure that it doesn't pick up that last double quote by accident.

lgalfaso added a commit that referenced this issue Nov 23, 2014
Email addresses can (under certain restrictions) include double quote
characters. See http://tools.ietf.org/html/rfc3696#section-3.

For example, `"Jo Bloggs"@abc.com` is a valid email address.

When serializing emails to the `href` attribute of an anchor element,
we must HTML encode these double quote characters. See
http://www.w3.org/TR/html-markup/syntax.html#syntax-attr-double-quoted

This commit does not attempt to improve the functionality (i.e. regex)
that attempts to identify email addresses in a general string.

Closes #8945
Closes #8964
Closes #5946
Closes #10090
Closes #9256
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants