This project is archived and is in readonly mode.
trivial regression on auto_link for non-western languages
Reported by Akira Matsuda | August 30th, 2010 @ 10:08 PM
As auto_link are supporting arbitrary URI schemes since
this commit, it now recognizes all the preceding full width
characters as a part of URI.
This might not be a bug, but at least a minor
specification change for those who read/write languages that don't
usually separate words by a space character.
Attached a patch avoiding this tiny regression, with a possible case for eastern people.
Comments and changes to this ticket
-
Masayoshi Takahashi September 11th, 2010 @ 06:24 AM
In RFC3986, scheme syntax of URI is:
scheme = ALPHA *( ALPHA / DIGIT / "+" / "-" / "." )
http://tools.ietf.org/html/rfc3986#section-3.1
So regexp in the patch should be:
(?: ([A-Za-z][0-9A-Za-z+.-]*:)// | www\. )
-
Santiago Pastorino January 31st, 2011 @ 10:55 PM
- Importance changed from to Low
Akira can you update your ticket according to the RFC?
-
Akira Matsuda January 31st, 2011 @ 11:39 PM
- Tag set to auto_link, edge, patch, tested
No.
I actually tried that regexp but the "view-source:http://en.wikipedia.org/wiki/URI_scheme" one didn't pass the test.
It is obvious that "view-source:http://..." does not follow the RFC, so I think there are two options.1) strictly follow the RFC
Revert the previous commit and drop support for "view-source:http://...", then implement the RFC3986 regexp as Takahashi-san suggested.2) support the RFC + much more schemes
This was the intent of my patch.What do you think?
-
Masayoshi Takahashi February 1st, 2011 @ 12:39 PM
I understand Akira's intent. It's OK to support URI format loosely, IMHO.
-
Repository February 1st, 2011 @ 04:06 PM
- State changed from new to committed
(from [cb9fa5283239e649483ea31ca372e99aaac2ca07]) auto_link: avoid recognizing full width chars as a part of URI scheme
fixes regression by http://github.com/rails/rails/commit/133ada6ab0f0cb7bef2bd40dbc18f2...
[#5503 state:committed]
Signed-off-by: Santiago Pastorino santiago@wyeworks.com
https://github.com/rails/rails/commit/cb9fa5283239e649483ea31ca372e...
Create your profile
Help contribute to this project by taking a few moments to create your personal profile. Create your profile »
<h2 style="font-size: 14px">Tickets have moved to Github</h2>
The new ticket tracker is available at <a href="https://github.com/rails/rails/issues">https://github.com/rails/rails/issues</a>
People watching this ticket
Attachments
Referenced by
- 5503 trivial regression on auto_link for non-western languages [#5503 state:committed]