[PATCH] short links also include mark '.'
[PATCH] short links also include mark '.'
| Issue ID: | 779 |
| Issue Category: | bug |
| Component: | ui |
| Priority: | major |
| Status: | fixed |
| Assigned: | Unassigned |
| Milestone: | 1.0 |
the new feature that makes short links when dents go above 140 chars, also includes the point mark that a user includes at the end of the sentence.
see http://identi.ca/notice/1107576
the system should be smart to discard that char.
related to ticket #31
| Attachment | Size |
|---|---|
| 779_autolinking.patch | 3.13 KB |
| 779_shorten_and_render.patch | 2 bytes |

Updates
#1
The code required for auto-linking text is now more advanced than can be handled by a single regex. The code for auto-linking was updated in #756, however #31 doesn't currently use the same code and thus we have this bug.
I have abstracted the auto-linking code into it's own function, and improved upon the functionality added by #756. To see a comparison of the auto-linking functionality in my patch vs #756 see http://iamseanmurphy.com/autolinking.php
#2
I believe that simply replacing the regex in common_shorten_links() with something like @https?://[^)\]>\s]+[A-Z0-9+&\@#\/%=~_|]@i ought to do the trick.
#3
A period could be part & end of an URI. See also #526
#4
@mkeisler As I stated above, auto-linking URLs is a complex task; so complex in fact, that it cannot properly be done with a single regular expression.
@Codeispoetry True, periods could be a part or end of a URI, but what is more common? The vast majority of cases where a regex picks up a period at the end of a URI is when the URI was placed at the end of a sentence. I think the solution should correctly handle the more common scenario.
You can also subscribe to the
RSS feed for updates to this issue.