diff --git a/mwparserfromhell/parser/tokenizer.c b/mwparserfromhell/parser/tokenizer.c index 4c6414e..d62b965 100644 --- a/mwparserfromhell/parser/tokenizer.c +++ b/mwparserfromhell/parser/tokenizer.c @@ -2508,10 +2508,7 @@ static int Tokenizer_verify_safe(Tokenizer* self, int context, Py_UNICODE data) } else if (context & LC_FAIL_ON_RBRACE) { if (data == '}') { - if (context & LC_TEMPLATE) - self->topstack->context |= LC_FAIL_ON_EQUALS; - else - self->topstack->context |= LC_FAIL_NEXT; + self->topstack->context |= LC_FAIL_NEXT; return 0; } self->topstack->context ^= LC_FAIL_ON_RBRACE; diff --git a/mwparserfromhell/parser/tokenizer.py b/mwparserfromhell/parser/tokenizer.py index 4422b5c..09eb799 100644 --- a/mwparserfromhell/parser/tokenizer.py +++ b/mwparserfromhell/parser/tokenizer.py @@ -1040,10 +1040,7 @@ class Tokenizer(object): self._context ^= contexts.FAIL_ON_LBRACE elif context & contexts.FAIL_ON_RBRACE: if this == "}": - if context & contexts.TEMPLATE: - self._context |= contexts.FAIL_ON_EQUALS - else: - self._context |= contexts.FAIL_NEXT + self._context |= contexts.FAIL_NEXT return True self._context ^= contexts.FAIL_ON_RBRACE elif this == "{": diff --git a/tests/tokenizer/comments.mwtest b/tests/tokenizer/comments.mwtest index ea2e89f..4bf82a9 100644 --- a/tests/tokenizer/comments.mwtest +++ b/tests/tokenizer/comments.mwtest @@ -37,3 +37,10 @@ name: incomplete_partial_close label: a comment that doesn't close, with a partial close input: "bingo" +output: [ExternalLinkOpen(brackets=False), Text(text="http://example.com/foo."), TemplateOpen(), Text(text="bar"), TemplateClose(), Text(text="baz.&biz;"), CommentStart(), Text(text="hello"), CommentEnd(), Text(text="bingo"), ExternalLinkClose()] diff --git a/tests/tokenizer/tags_wikimarkup.mwtest b/tests/tokenizer/tags_wikimarkup.mwtest index feff9c5..04f617a 100644 --- a/tests/tokenizer/tags_wikimarkup.mwtest +++ b/tests/tokenizer/tags_wikimarkup.mwtest @@ -244,6 +244,13 @@ output: [Text(text="''"), TagOpenOpen(wiki_markup="''"), Text(text="i"), TagClos --- +name: unending_bold_and_italics +label: five ticks (bold and italics) that don't end +input: "'''''testing" +output: [Text(text="'''''testing")] + +--- + name: complex_ul label: ul with a lot in it input: "* this is a test of an [[Unordered list|ul]] with {{plenty|of|stuff}}"