diff --git a/mwparserfromhell/parser/tokenizer.c b/mwparserfromhell/parser/tokenizer.c index a8c69e7..a3e2a95 100644 --- a/mwparserfromhell/parser/tokenizer.c +++ b/mwparserfromhell/parser/tokenizer.c @@ -1045,6 +1045,14 @@ Tokenizer_really_parse_entity(Tokenizer* self) if (this == *MARKERS[j]) FAIL_ROUTE_AND_EXIT() } + j = 0; + while (1) { + if (!valid[j]) + FAIL_ROUTE_AND_EXIT() + if (this == valid[j]) + break; + j++; + } text[i] = this; self->head++; i++;