[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kfm-devel
Subject:    Re: \n before <html
From:       Waldo Bastian <bastian () ens ! ascom ! ch>
Date:       1999-07-26 12:59:11
[Download RAW message or body]

David Faure wrote:
> 
> On Sat, Jul 24, 1999 at 06:32:35PM +0200, Stephan Goetter wrote:
> > Hi,
> >
> > I try to fix a bug in KMimeMagic.cpp before kde-1.1.2.
> > I hope you can help me.
> >
> > This is my test file.
> > --------
> > \n
> > <html><head>
> > </head><body></body></html>
> > --------
> >
> > Because the first character is a newline, text/html is not recognized.
> > The newline would be "eaten up" (set to \0) in mconvert()
> > case STRING:
> > /* Null terminate and eat the return */
> > p->s[sizeof(p->s) - 1] = '\0';
> > if ((rt = strchr(p->s, '\n')) != NULL)
> > *rt = '\0';
> > return 1;
> >
> > Because "\0<html" isn't the same like "<html" mcheck() fails :(
> 
> Yes I came accross this before.
> But could some HTML expert out there comment on this ? Is it valid HTML
> if the document doesn't start with <html> first thing ?
> Your analysis on why it fails is right, but see below for more.

White-space and SGML comments are ignored by HTML. The first TAG has to be
<HTML...> but I guess that before this tag an unlimited amount of white-space
and SGML-comment may occur.

This explains at least why they use this <!DOCTYPE header to specify the
HTML version. Technically this is SGML comment and therefore shouldn't break
exisiting (HTML 1.x or so) applications.

Cheers,
Waldo
-- 
The "gui" in "Penguin" is pronounced "K-D-E"

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic