User Comments
Mike P.: I took the liberty of editing your comment (#2) since it was the victim of a bug in the “diffs” code that kicks in after a comment has been edited. Namely that URL hyperlinks become “escaped” resulting in the less-than and greater-than characters being displayed rather than acting as containers for HTML (another reason why the parser needs to allow mark-up). I’ve had a look at Alex King’s code samples but, while they are impressive, I don’t think I’ll use them. I would prefer to have all the parsing in the handler (so that parsing would be performed during page generation) rather than in the page (where parsing would be performed during rendering). I am always aware that many users turn JavaScript off, which would obviously “break” the system. Thanks for pointer though. |
hmm. Just finished making the first coffee, and can see that I wasn’t very clear… I meant developing some JS buttons that the user can use to insert markup into the textarea to ease the making of a ‘pro’ comment. One thing I have seen is the odd person complaining that having to markup comments can be a bit.. heavy, I suppose. That would be why a system like yours would be quite good, having the best of both worlds… |
Are you advocating a switchable WYSIWYG editor Mike? I guess I could this. By default a WYSIWYG editor, but a button allows the more advanced user to switch to a plain textarea. If I did this, I’d make it so that your preference would be remembered too. Or have I misunderstood? |
Hey, late reply butt… I meant having a simple javascript button thingy as more of a courtesy. People could hand code, hit a button for tags, or simple simply not enter any markup whatsoever… (what’s up with all of this coach/trainer insanity in the footy world?) NOTE: This comment has been edited by its author! Additions are shown in italics, deletions with a strike-through. |
I see. Well I’ll see what I can do when I start writing the module. Don’t get me started on football Mike. My team (Leeds United) has just been relegated and might not even exist for much longer! England is about to get crushed (again) in Euro 2004. I think “insanity” is a great word to describe the sport’s current shenanigans. Who’s your team Mike (totally non-hostile question)? |
I might not need to write any code at all for this… I have just discovered a wonderfully elegant and simple system, called Markdown, which was developed my John Gruber over at Daring Fireball. Markdown uses a syntax similar to that which some will recognise from email and Usenet usage. The parser is written in Perl and is released under the GPL. Please take a look at: http://daringfireball.net/projects/markdown/ and let me know if you think this is suitable. |
The not-quite-totally-out-of-context comment… Iñtërnâtiônàlizætiøn (see: http://tinyurl.com/259ed and all will be made clear - well, clearer). |
これは日本語のテキス… トです。読めますか देखें हिन्दी कैसी नजर आती है। अरे वाह ये तो नजर आती है। Testing to see if my Unicode support is complete… |
“previewing of comments would be nice, even if you can edit them…” I agree, especially if I introduce Markdown. It would be beneficial to be able to preview if you’ve gone to the trouble of adding formatting. |
IMPORTANT: I have been playing with John Gruber’s Markdown to see if it is worth introducing here and I am completely sold on it. It is easy use, the syntax is straightforward (after a slight learning curve) and the results are styled comments in valid XHTML. There’s an awful lot of flexibility in there too. It’s really rather neat. I have decided to use it here! I recommend you head on over to http://daringfireball.net/projects/markdown/dingus where you can try it out. Please test it. If you don’t like it, LET ME KNOW - because I’d like to deploy it as soon as possible. Thank you. |
Testing comment markup with an adaptation of John Gruber’s Markdown. Markdown is a plug-in for Movable Type, amongst others. The logo for Movable Type should be displayed below: Along with the embedded hyperlink and the oh-so-cool image link facilities, Markdown provides plenty of other tags for comment enhancement. Let’s Try a Few… Bulleted Lists:
Numbered Lists Too:
You can even post code snippets now:
All in all, Markdown is a very cool plug-in… |
The comments handler has now been extended to address the issues discussed here. |
Simon’s class is really quite good. Making it work along with what you have already, that is, allowing a ‘pro’ mode and a… ‘standard’ mode would be very cool.
With respect to markup, I’ve been playing witht using some javascript to insert tags where needed. Alex King has a snippet of code here that does what I’d like, however it works with names, not id’s, and I’m not quite sure how I’d get it working when we deliver application/xhtml+xml.
Can’t say that I have thought about it much, but someone ‘here’ is supposed to be looking into it…
(Hmm, previewing of comments would be nice, even if you can edit them…)