From kfm-devel Mon Jul 26 12:59:11 1999 From: Waldo Bastian Date: Mon, 26 Jul 1999 12:59:11 +0000 To: kfm-devel Subject: Re: \n before > 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 > > > > > > -------- > > > > 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 > 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 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 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