From 9eb7459632e7cd332d0397a1cf828982fddf1c96 Mon Sep 17 00:00:00 2001 From: David Ebbo Date: Wed, 3 Jan 2024 09:27:01 +0100 Subject: [PATCH] Increase MAX_DEPTH to 100 --- src/mwparserfromhell/parser/ctokenizer/tok_support.h | 2 +- src/mwparserfromhell/parser/tokenizer.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mwparserfromhell/parser/ctokenizer/tok_support.h b/src/mwparserfromhell/parser/ctokenizer/tok_support.h index e877f7c..e8a9c63 100644 --- a/src/mwparserfromhell/parser/ctokenizer/tok_support.h +++ b/src/mwparserfromhell/parser/ctokenizer/tok_support.h @@ -49,7 +49,7 @@ Py_UCS4 Tokenizer_read_backwards(Tokenizer *, Py_ssize_t); /* Macros */ -#define MAX_DEPTH 40 +#define MAX_DEPTH 100 #define Tokenizer_CAN_RECURSE(self) (self->depth < MAX_DEPTH) #define Tokenizer_IS_CURRENT_STACK(self, id) \ (self->topstack->ident.head == (id).head && \ diff --git a/src/mwparserfromhell/parser/tokenizer.py b/src/mwparserfromhell/parser/tokenizer.py index dcdfcee..85032cb 100644 --- a/src/mwparserfromhell/parser/tokenizer.py +++ b/src/mwparserfromhell/parser/tokenizer.py @@ -92,7 +92,7 @@ class Tokenizer: END, ] URISCHEME = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+.-" - MAX_DEPTH = 40 + MAX_DEPTH = 100 regex = re.compile(r"([{}\[\]<>|=&'#*;:/\\\"\-!\n])", flags=re.IGNORECASE) tag_splitter = re.compile(r"([\s\"\'\\]+)")