CREATIVE COW: Feedback Forum About Us Contact Us Support Articles

Special characters in scripts and expressions

COW Forums : Letters to the COW Team

<< PREVIOUS   •   FAQ   •   VIEW ALL   •   PRINT   •   NEXT >>
cow
Filip VanduerenSpecial characters in scripts and expressions
by on Mar 16, 2007 at 8:01:15 pm

Hi there,

a technical question,

check out this thread:
http://forums.creativecow.net/cgi-bin/new_read_post.cgi?forumid=227&postid=...

It contains an expression that uses greater than and lesser than symbols, which would break the HTML in the page.

I can circumvent the problem by using the html code starting with the ampersant < >

That would look good on the site, but is unreadable in the e-mails, and can't be copy-pasted from the e-mail.
Also, not everyone who'd like to share an expression would know or think about the < problem...

Is there a technical way to filter these problems out automatically ?

Also I'd like to use the PRE tag so I can show the indenting in my expressions, but that adds an extra 2nd linebreak after each line.

Anyways, I hope this won't cause too many headaches,
and also thanks again for welcoming me to the cow leadership team


Return to posts index

Post removed.

cow
Eric BlissRe: Special characters in scripts and expressions
by on Mar 27, 2007 at 4:26:42 pm

Hello Filip.

Unfortunately, this is somewhat problematic. The cow mechanism is a mechanism, not an AI. It doesn't really know how to decide if somebody wants a particular angle bracket to be a mathematical symbol or part of an HTML tag. Imagine that somebody is writing out a reply, and while they're talking, they want to emphasize something. But then they want to say that ( 5 < span ) and a little bit later that ( 7 > height ). Now, I've written things properly here. But if they didn't use the encoded form of "less than" and "greater than" inside the parenthesis, it would look like " span ) and a little bit later that ( 7 " was intended to be some kind of HTML code. Of course, a human would know that this isn't what is intended, but a script doesn't know that, and it's made worse, since "span" is a valid HTML tag, that can have a lot of stuff in it.

This isn't to say that it would be IMPOSSIBLE to fix, just that it's not a simple fix. And for a complex fix, the question has to be asked "Is the time spent on this worth it, or are there more pressing things to work on?" Unfortunately, this kind of function just isn't in the near future.

Eric Bliss

systems design and integration
CreativeCow.Net

int main(void) {
printf("Hello World!n");
}


Return to posts index


cow
Filip VanduerenRe: Special characters in scripts and expressions
by on Apr 15, 2007 at 2:52:47 pm

Hi Eric,

I'm coming back (again) to the problem of lesser than / open html tag characters in javascript snippets.
I was researching CMS's and found the following module for Drupal:

http://drupal.org/project/codefilter
This is a simple filter module. It handles code and php tags so that users can post code without having to worry about escaping with < and >

I see you're using drupal for the blogsection, so I thought I'd point you there.

Dan Ebberts & I are allready in the habit of using CODE-tags so you might be able to lift the subroutines. Perhaps we could put a sticky in the expressions forum on how to post code ?

I'll shut up about it now ;-)

Filip




Return to posts index

<< PREVIOUS   •   VIEW ALL   •   PRINT   •   NEXT >>
© 2016 CreativeCOW.net All Rights Reserved
[TOP]