View Ticket
Not logged in
Ticket UUID: 675aaa3458199c8832c6879b43325ffb2fd62e75
Title: fossil says valid html element is invalid
Status: Fixed Type: Code_Defect
Severity: Important Priority:
Subsystem: Resolution: Fixed
Last Modified: 2010-09-26 11:11:35
Version Found In: 3243e63bba
Description & Comments:
<hr/> is a valid xhtml element. Fossil says it is not. However <hr /> and <hr id='hrid'/> are considered valid.

The problem is in wikiformat.c:markupLength in the line

while( isalnum(z[n]) ){ n++; }

==> if( (c = z[n])!='>' && !isspace(c) ) return 0;

while( (c = z[n])!=0 && (c!='>' || inparen) ){

renez added on 2010-09-24 21:51:04:
looking further at the routine it will invalidate this to

  • <img src="img.png" alt="d'art noir" title="/> black art" />
  • < hr />

This will do a bit better but will still not catch all

like <hr//> will be valid

static int markupLength(const char *z){
  int n = 1;
  int quote;
  int c;
  if( z[n]=='/' ){ n++; }
  while(isspace(z[n])) n++;
  if( !isalpha(z[n]) ) return 0;
  n++;
  while(isalnum(z[n])) n++;
  while( (c = z[n]) && c!='>'){
    if( c=='"' || c=='\'' ){
      n++;
      for(quote=c; (c=z[n]) && c!=quote; n++) ; //look for the same closing quote
      if(!c) return 0;
    }
    n++;
  }
  return c ? n+1 : c ;
}