Skip to content

Commit 77a41f8

Browse files
committed
Fix regexp pattern python 3.13 compatibility issue
Fix syntax error raised by global pattern flags not being located at the beginning of various patterns.
1 parent bc44603 commit 77a41f8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

vendor/bibtex/tex.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ def split_tex_string(string, maxsplit=-1, sep=None):
1111

1212
if sep is None:
1313
# tilde == non-breaking space
14-
sep = r"(?u)[\s~]+"
14+
sep = r"[\s~]+"
1515

1616
result = []
1717

@@ -23,7 +23,7 @@ def split_tex_string(string, maxsplit=-1, sep=None):
2323
splits = 0
2424

2525
i = 0
26-
next_break = re.compile(r"\{|}|(?P<sep>" + sep + ")")
26+
next_break = re.compile(r"\{|\}|(?P<sep>" + sep + r")", re.IGNORECASE | re.UNICODE)
2727

2828
while i < string_len:
2929
match = next_break.search(string, i)
@@ -52,4 +52,4 @@ def split_tex_string(string, maxsplit=-1, sep=None):
5252

5353

5454
def tokenize_list(list_str, _and="and"):
55-
return split_tex_string(list_str, sep=r"(?iu)(?:|([\s~])+)" + _and + r"(?:[\s~]+|$)")
55+
return split_tex_string(list_str, sep=r"(?:|([\s~])+)" + _and + r"(?:[\s~]+|$)")

0 commit comments

Comments
 (0)