Beispiel #1
0
 public override void Read(Tokeniser t, CharacterReader r)
 {
     if (r.MatchesLetter())
     {
         t.CreateDoctypePending();
         t.Transition(DoctypeName);
         return;
     }
     char c = r.Consume();
     switch (c)
     {
         case '\t':
         case '\n':
         case '\r':
         case '\f':
         case ' ':
             break; // ignore whitespace
         case _nullChar:
             t.Error(this);
             t.DoctypePending.Name.Append(_replacementChar);
             t.Transition(DoctypeName);
             break;
         case _eof:
             t.EofError(this);
             t.CreateDoctypePending();
             t.DoctypePending.ForceQuirks = true;
             t.EmitDoctypePending();
             t.Transition(Data);
             break;
         default:
             t.CreateDoctypePending();
             t.DoctypePending.Name.Append(c);
             t.Transition(DoctypeName);
             break;
     }
 }
Beispiel #2
0
 public override void Read(Tokeniser t, CharacterReader r)
 {
     char c = r.Consume();
     switch (c)
     {
         case '\t':
         case '\n':
         case '\r':
         case '\f':
         case ' ':
             t.Transition(BeforeDoctypeName);
             break;
         case _eof:
             t.EofError(this);
             t.CreateDoctypePending();
             t.DoctypePending.ForceQuirks = true;
             t.EmitDoctypePending();
             t.Transition(Data);
             break;
         default:
             t.Error(this);
             t.Transition(BeforeDoctypeName);
             break;
     }
 }