[Wikipedia-l] Re: Incorrect HTML encoding--something new?

Simon Kissane sj_kissane at yahoo.com
Sun Jan 13 17:26:51 UTC 2002


--- Lars Aronsson <lars at aronsson.se> wrote:
> Jimmy wrote:
> > Obviously, there's no way for us to pass all the
> > webpages through a validator (or, is there?) since

> > end users might well write invalid or
> > at least not-perfect html.
> 
> When I first thought of this, I thought it will
> never work because you allow HTML markup inside the 
> user-edited wiki text. 
> Then I found out that this is wrong.  Think again!  
> Each user can run her favorite page through the 
> validator and fix the HTML code in the user-edited 
> wiki text until it passes.
[snip]
I can think of another possibility. Since we only
allow a limited subset of HTML tags, and we only
interpret it as a HTML tag if its properly formed
(right?), we are already on the way to producing valid
HTML output. Basically, if the user types invalid HTML
into the wiki page, the software should either
automatically correct it on display, or display it
raw. Thus e.g. "<nonexistenttag>" will be outtputted
to the browser as "&lt;nonexistenttag&gt;", "<LI>"
will automatically have a closing "</LI>" added to it,
and "<a href="http://www.foo.com"
attributeimadeup="yes">" will have the
"attributeimadeup" dropped from it.

That way, the output of the script on display will
always be valid HTML, even if the user types bad HTML
in to begin with.

Of course, this will make the parser in the script
more complicated...

In fact, if we wanted to, we could even produce XHTML
output to the browser, and yet take HTML in the page
source.

Simon J Kissane

__________________________________________________
Do You Yahoo!?
Send FREE video emails in Yahoo! Mail!
http://promo.yahoo.com/videomail/



More information about the Wikipedia-l mailing list