|
|---|
| Replies are listed 'Best First'. | |||||||||
|---|---|---|---|---|---|---|---|---|---|
|
JavaScript is indeed a bad thing
by Corion (Patriarch) on Jun 01, 2000 at 16:11 UTC | |||||||||
You seem to be testing the Perlmonks engine to the limit it seems :) but you are right indeed, not stripping the <SCRIPT> tags from HTML is bad, as I don't see any valid reason why people would want to see JavaScript in the posts here. I think the following code should strip all <SCRIPT> tags : My reason for the parentheses is that only a person with bad intent would want to use JavaScript in nodes anyway and could maybe try to trick the code into not stripping the script by adding some attributes to the closing part of the script tags. On another side, I think also <FONT> tags and other things (like color etc.) should be avoided. Maybe it would be better to have a positive list of allowed tags instead of allowing Everything and then banning some special tags... My list of "good" tags would be more or less the following :
Also, the engine could maybe even check for ill-formed HTML, that is, unclosed tags. I hate it if somebody posts with <PRE> and then does not close the tag so that all subsequent text is rendered as preformatted in Courier New. But that one requires much more analysis I think - or maybe not. An idea from the top of my head :
This method is crude and maybe destroys more than it does good - maybe instead of fixing the HTML, the engine should simply return a warning like Update: vroom has a post about his position on HTML online now. | [reply] [d/l] | ||||||||
by turnstep (Parson) on Jun 04, 2000 at 18:30 UTC | |||||||||
Great idea about limiting the HTML You seem to have forgotten the <STRONG> and <EM> tags. Those of us who have been doing HTML for a while know that these are more correct than using <B> and <I>. <CENTER> should not be included as it has been deprecated. In addition, we should consider: | [reply] | ||||||||
by . (Acolyte) on Jun 10, 2000 at 08:21 UTC | |||||||||
STRONG was created by a false analogy. EM is for emphasis, that makes sense, but what does STRONG mean? In reality, STRONG and EM represent different levels of emphasis. Nir Dagan said on the www-html list: A common myth is that <strong> is better than <b> since it gives the user (or browser) the option to control the style better. This is wrong since <b> and <strong> all have the same syntax properties in HTML and admit the same style rules.Jon Roland Eriksson on the www-html mailing list: But a double <EM> sounds very close to <STRONG> to me.However, in the case of I vs. EM, EM still wins. I sets the enclosed text in italics no matter the context. But this means <i> level 1<i> level 2</i></i> is rendered completely in italics making level 2 indistinquishable from level 1. EM does not have this problem: <em>level 1<em> level 2</em></em> renders level 1 in italics and level 2 in upright text. I'm sure you're thinking "who cares" by now... but it's important to note STRONG is not better than B while I is better than EM. | [reply] | ||||||||
|
RE: JavaScript allowed in posts!
by BBQ (Curate) on Jun 02, 2000 at 09:09 UTC | |||||||||
#!/home/bbq/bin/perl # Trust no1! | [reply] | ||||||||