Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2011-01-25 Thread Lukas Fleischer
On Sun, Oct 03, 2010 at 09:51:45PM +0200, Lukas Fleischer wrote: > Comments are now split at link boundaries and links are converted > separately. I find this to be a much cleaner way than re-converting > comments that have already been converted using htmlspecialchars(). This > also doesn't requir

[aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-10-03 Thread Lukas Fleischer
Comments are now split at link boundaries and links are converted separately. I find this to be a much cleaner way than re-converting comments that have already been converted using htmlspecialchars(). This also doesn't require any callback procedure. --- web/lib/aur.inc | 24

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-10-02 Thread Loui Chang
On Fri 01 Oct 2010 01:05 +0200, Lukas Fleischer wrote: > On Thu, Sep 30, 2010 at 08:56:56PM +0200, PyroPeter wrote: > > You can also link to a homepage using valid URL's. The additional > > "feature" may be nice, but makes the code more complex. It also > > trains users to omit the "http://"; and p

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-10-01 Thread Jan-Erik Rediger
On Fri, Oct 01, 2010 at 06:23:06PM +0200, PyroPeter wrote: > On 10/01/2010 05:52 PM, Lukas Fleischer wrote: > >This won't match URLs like > >"https://aur.archlinux.org/packages.php?O=0&K="; and an ampersand at the > >end of an URL won't be converted correctly :/ I'll try to implement it a > >more p

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-10-01 Thread Lukas Fleischer
On Fri, Oct 01, 2010 at 06:23:06PM +0200, PyroPeter wrote: > About splitting at boundaries: Contrary to what I have said before, > using regular expressions seems to be a valid and efficient way. > (I thought you would have to escape tag-content and attributes in > different ways (percent-encoding

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-10-01 Thread PyroPeter
On 10/01/2010 05:52 PM, Lukas Fleischer wrote: This won't match URLs like "https://aur.archlinux.org/packages.php?O=0&K="; and an ampersand at the end of an URL won't be converted correctly :/ I'll try to implement it a more proper way the next days. Maybe I'll actually go with splitting comments

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-10-01 Thread Lukas Fleischer
On Fri, Oct 01, 2010 at 04:59:22PM +0200, PyroPeter wrote: > I fixed the bugs and changed the indention to tabs. > I also changed the regex to one that accepts everything > that starts with one of 'http', 'https' or 'ftp' followed by > a colon ":", contains no whitespace and ends with a letter (\w

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-10-01 Thread PyroPeter
On 09/30/2010 05:22 PM, Lukas Fleischer wrote: This is a bit hacky patch to make links in AUR comments clickable (fixes FS#20137 [1]). Huge parts of this code are ripped from the DokuWiki plugin that is also used in Flyspray. I didn't have any time to test it extensively so I'd suggest to do som

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-10-01 Thread Lukas Fleischer
On Fri, Oct 01, 2010 at 02:15:41PM +0200, PyroPeter wrote: > I did not mean to offend you, and after applying the patch (which I > should have done before sending the mails, you are right) your code > in fact seems to work a lot better then I thought. I didn't feel offended in any way, but reporti

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-10-01 Thread PyroPeter
On 10/01/2010 02:15 PM, PyroPeter wrote: I did not mean to offend you, and after applying the patch (which I should have done before sending the mails, you are right) your code in fact seems to work a lot better then I thought. While testing, I found a bug: Post this URL: http://foo.bar/<><>; It

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-10-01 Thread PyroPeter
On 10/01/2010 01:05 AM, Lukas Fleischer wrote: Please don't just assume things but test your examples using a current GIT checkout with the patch applied in future. I did not mean to offend you, and after applying the patch (which I should have done before sending the mails, you are right) your

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-09-30 Thread Lukas Fleischer
On Thu, Sep 30, 2010 at 08:56:56PM +0200, PyroPeter wrote: > Well, but you are encoding existing entities, that are not "&" as > "&foo;". See the example below. Yep, and that's how it's supposed to be. There shouldn't be any entities that users put in the comments and that are not encoded. > I se

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-09-30 Thread PyroPeter
On 09/30/2010 06:38 PM, Lukas Fleischer wrote: On Thu, Sep 30, 2010 at 06:18:24PM +0200, PyroPeter wrote: + $url = str_replace('&','&', $url); + $url = str_replace('&', '&', $url); What about the occurrences of "&(html-entity-code-here);" you produced the line before? Nothing? Any occu

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-09-30 Thread Lukas Fleischer
On Thu, Sep 30, 2010 at 06:18:24PM +0200, PyroPeter wrote: > >+ $url = str_replace('&','&', $url); > >+ $url = str_replace('&', '&', $url); > > What about the occurrences of "&(html-entity-code-here);" you > produced the line before? Nothing? Any occurrence of an HTML entity code is correct

Re: [aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-09-30 Thread PyroPeter
On 09/30/2010 05:22 PM, Lukas Fleischer wrote: This is a bit hacky patch to make links in AUR comments clickable (fixes FS#20137 [1]). Huge parts of this code are ripped from the DokuWiki plugin that is also used in Flyspray. I didn't have any time to test it extensively so I'd suggest to do som

[aur-dev] [PATCH] Make external links in comments clickable (FS#20137).

2010-09-30 Thread Lukas Fleischer
This is a bit hacky patch to make links in AUR comments clickable (fixes FS#20137 [1]). Huge parts of this code are ripped from the DokuWiki plugin that is also used in Flyspray. I didn't have any time to test it extensively so I'd suggest to do some more tests if this will be commited. [1] https