looking further at the routine it will invalidate this to

  *  &lt;img src="img.png" alt="d'art noir" title="/> black art" />
  *  &lt; hr />

This will do a bit better but will still not catch all
<verbatim>
like 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++) ; for the same closing quote
      if(!c) return 0;
    }
    n++;
  }
  return c ? n+1 : c ;
}
</verbatim>