Whilst re-hosting the Wiki::Toolkit development wiki (it's now at http://movieos.org/wiki-toolkit/) we discovered that CGI::Wiki::Formatter::Pod requires the line-endings of the thing it's formatting to be unix-style. This wasn't a problem till I started pointing Safari at it - you're clearly all firefox users - but would be under 'normal' usage.
Rather than fix the formatter, I think it's probably better to ensure that whatever formatter we use is always passed unix line endings. This patch (to CGI::Wiki) does this.
Actually, now I think about it, would we prefer a patch that ensures that the node contents as stored in the database always have unix line endings, ie move this match to before the node store operation?
tom
On Fri 29 Oct 2004, Tom Insam tinsam@fotango.com wrote:
Rather than fix the formatter, I think it's probably better to ensure that whatever formatter we use is always passed unix line endings. This patch (to CGI::Wiki) does this.
I'd rather fix this in the formatter; can you send a patch for that, please?
Kake
On Oct 31, 2004, at 14:35, Kake L Pugh wrote:
On Fri 29 Oct 2004, Tom Insam tinsam@fotango.com wrote:
Rather than fix the formatter, I think it's probably better to ensure that whatever formatter we use is always passed unix line endings. This patch (to CGI::Wiki) does this.
I'd rather fix this in the formatter; can you send a patch for that, please?
Attached.
But why? My preferred of the three patches is the 'fix before it goes into the store' patch - I like the idea that you can trust what's in the store to have this particular sort of line-ending. What happens when some other formatter also makes this fairly reasonable assumption about line-endings? The only flaw with it that I see is that we probably _also_ need the line endings fixing patch for stuff coming out of the store, to fix legacy data stores. But that's (a) transitional, and (b) harmless.
tom
On Fri 29 Oct 2004, Tom Insam tinsam@fotango.com wrote:
Whilst re-hosting the Wiki::Toolkit development wiki (it's now at http://movieos.org/wiki-toolkit/) we discovered that CGI::Wiki::Formatter::Pod requires the line-endings of the thing it's formatting to be unix-style. This wasn't a problem till I started pointing Safari at it - you're clearly all firefox users - but would be under 'normal' usage.
As promised last night, I looked at this again this morning, but I'd just like to make sure we're fixing the right problem and all the right problems.
I have this feeling in the back of my mind that I read somewhere that the CGI standard is to use the "\r\n" line ending, and I have snippets in various bits of my code that seem to back this up. Anyone know if this is actually so?
I also realise that I'm not clear on how the problem is manifesting itself for you. Could you give more details please?
Kake
As promised last night, I looked at this again this morning, but I'd just like to make sure we're fixing the right problem and all the right problems.
I have this feeling in the back of my mind that I read somewhere that the CGI standard is to use the "\r\n" line ending, and I have snippets in various bits of my code that seem to back this up. Anyone know if this is actually so?
It is. But I also don't care. Despite the name, I don't see CGI::Wiki as being anything to do with CGI scripts - it's an app that stores wiki nodes and associated metadata. And as such, I'd like to put unix line endings in the database, because I'm a unix nerd, and I think most people expect unix line endings.
I'm open to convincing that I'm wrong. But the CGI spec isn't a good reason.
I also realise that I'm not clear on how the problem is manifesting itself for you. Could you give more details please?
I'm hazy on the detains now, annoyingly. The problem was that some formatters (I can't remember which one any more, probably usemod..) were expecting a certain type of line ending. Hitting the wiki (from a mac?) was uploading data with other sorts of line endings, and the pages were getting formatted into one huge lump. I'll run something without the patch briefly and try to reproduce it.
tom
Kake wrote:
I have this feeling in the back of my mind that I read somewhere that the CGI standard is to use the "\r\n" line ending, [...]
On Thu 16 Dec 2004, Tom Insam tom@jerakeen.org wrote:
It is. But I also don't care. Despite the name, I don't see CGI::Wiki as being anything to do with CGI scripts [...]
No, no, you misunderstand. I'm just trying to pin down exactly what's causing your problem.
I'd like to put unix line endings in the database, because I'm a unix nerd, and I think most people expect unix line endings.
I think if you want to put unix line endings in the database, then you should give CGI::Wiki unix line endings.
Kake