FS#14391 - Wrapping comments in <pre> tags

Attached to Project: AUR web interface
Opened by Ronuk Raval (rraval) - Sunday, 19 April 2009, 23:03 GMT
Last edited by Lukas Fleischer (lfleischer) - Thursday, 12 July 2012, 06:12 GMT
Task Type Feature Request
Category Backend
Status Closed
Assigned To Lukas Fleischer (lfleischer)
Architecture All
Severity Medium
Priority Normal
Reported Version 1.5.6.2
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 4
Private No

Details

Right now, AUR eats up all whitespace in comments. Examining the HTML shows that the whitespace is there, and the bug is caused because of HTML's whitespace agnosticism. This is particularly annoying when posting a patch, which requires whitespace before contextual lines. If the leading whitespace isn't there, 'patch' will reject the diff as corrupt.

This makes it literally impossible to post patches in comments. Possible fixes include wrapping comment content in HTML <pre> tags, forcing the rendering of whitespace.
This task depends upon

Closed by  Lukas Fleischer (lfleischer)
Thursday, 12 July 2012, 06:12 GMT
Reason for closing:  Won't implement
Additional comments about closing:  Use a pastebin for posting patches.
Comment by Callan Barrett (wizzomafizzo) - Wednesday, 29 April 2009, 11:52 GMT
I would prefer begin able to attach patches/pkgbuilds to posts rather than pre tags. It probably isn't that much harder to do this.
Comment by Ronuk Raval (rraval) - Thursday, 30 April 2009, 01:35 GMT
Well, being able to attach files would be awesome. I wouldn't ask Santa for anything more this year if I could get that. It would also allow one to focus comments on actual content that COMMENTS on something, rather than delimiting code.

So yeah, if attachments are possible and someone has the time to spare, you are my new hero. Otherwise, I could live with just a few <pre> tags.
Comment by Loui Chang (louipc) - Thursday, 30 April 2009, 11:58 GMT
I prefer pastebin. No need to keep old patches/pkgbuilds rotting in the database is there?
Comment by Callan Barrett (wizzomafizzo) - Thursday, 30 April 2009, 12:11 GMT
Damn it Loui it'll take way longer to write a pastebin into the AUR!!!!! Time is money!
Comment by Ronuk Raval (rraval) - Thursday, 30 April 2009, 22:21 GMT
Well, if someone is going to write a pastebin, I demand my syntax highlighting.

More seriously though, could a package not summarize a list of attachments and allow people to flag them out of date? As for rotting patches and PKGBUILDs, AUR already stores comments in it's database. Comments that sometimes contain patches and PKGBUILDs, and are usually outdated in a few weeks. Thus it isn't really much of a storage problem, more of a organizational one.

If the organization is too much to code, like I've said before, I find that the addition of <pre> tags to be an adequate compromise. At least then one can post patches without getting mangled.

And I find it interesting that you mention pastebin. The unified diff format requires that the diff range be specified between double "@" signs, a delimiter that pastebin also uses for its own purposes. Posting a patch to pastebin will mangle it beyond just spaces, it will remove needed delimiters.
Comment by Loui Chang (louipc) - Sunday, 03 May 2009, 07:20 GMT
> And I find it interesting that you mention pastebin. The unified diff format requires that the diff range be
> specified between double "@" signs, a delimiter that pastebin also uses for its own purposes. Posting a patch
> to pastebin will mangle it beyond just spaces, it will remove needed delimiters.

Hmm! Your pastebin is faulty. I think it may benefit many people to fix that.
I find myself pasting patches often enough and haven't had problems.
Comment by Ronuk Raval (rraval) - Sunday, 03 May 2009, 16:08 GMT
@Loui: Yep, you're right, the problem I was describing seems to be localized to pastebin.com and derivatives. After shopping around a bit more, there are others which allow posting patches with no problems. Thanks.

Now, a question remains about the focus of the comments. Do we wish for them do be completely self standing without any reliance on other sites? Personally, I find the pastebin thing to be adequate (now that I've found one that works well enough), but would still prefer all files about an AUR package being kept local to AUR. However, that decision ultimately falls upon the developers.
Comment by Tomas Mudrunka (harvie) - Tuesday, 09 June 2009, 20:54 GMT
1.) preformated text in comments is definetely GOOD IDEA
2.) you can also replace URLs by links - since there are lot of URLs in AUR comments. (it should be nice to replace also URLs in older comments after implementing that)
3.) there is annoying space character added to end of each comment (this should be replaced by something different - eg. line break?)
Comment by Karol Błażewicz (karol) - Saturday, 01 May 2010, 17:46 GMT
Err, can sb remove the above "comment"?
Comment by Martin Kühne (mar77i) - Saturday, 21 May 2011, 02:55 GMT
+1
How far are we with this coming in one of the more soonish applied versions of aur code?
Is there a patch already? are reviews/testing needed?

PKGBUILDs can't be passed additional configuration, as I guess gentoo permits, so patches for aur packages seem kinda plausible.
Many aur packages are extended versions of those in the repos, anyway.
Note that posting a short diff in comments results in broken diff code, as seen in [1].

[1] http://aur.archlinux.org/packages.php?ID=11364

Edit: uh, no idea what package that was, I'm sorry. :)
Comment by Manuel Tortosa (manutortosa) - Saturday, 18 June 2011, 02:37 GMT
I tried several solutions for this in CCR, and this one works perfect:

https://gitorious.org/chakra-webdev/ccr/commit/40a392bf77418c29c84f0f08a19ec1155bae7807

is a tiny change in the CSS and add the proper <pre></pre>, this allows not only post patches but well formatter build logs having a proper text wrap.
Comment by Manuel Tortosa (manutortosa) - Saturday, 18 June 2011, 02:42 GMT
Comment by Tom Medhurst (tommed) - Thursday, 13 October 2011, 12:50 GMT
Why not enable bbcode/textile/redcloth in the comment field?
Comment by Lukas Fleischer (lfleischer) - Thursday, 13 October 2011, 13:14 GMT
tommed: Because we don't need it.

Loading...