public void containsIgnoreCase() { CharacterReader r = new CharacterReader("One TWO three"); Assert.IsTrue(r.ContainsIgnoreCase("two")); Assert.IsTrue(r.ContainsIgnoreCase("three")); // weird one: does not find one, because it scans for consistent case only Assert.IsFalse(r.ContainsIgnoreCase("one")); }
// from < in rcdata public override void Read(Tokeniser t, CharacterReader r) { if (r.Matches('/')) { t.CreateTempBuffer(); t.AdvanceTransition(RcDataEndTagOpen); } else if (r.MatchesLetter() && !r.ContainsIgnoreCase("</" + t.AppropriateEndTagName())) { // diverge from spec: got a start tag, but there's no appropriate end tag (</title>), so rather than // consuming to EOF; break out here t.TagPending = new Token.EndTag(t.AppropriateEndTagName()); t.EmitTagPending(); r.Unconsume(); // undo "<" t.Transition(Data); } else { t.Emit("<"); t.Transition(RcData); } }