Skip to content

Commit 9c86368

Browse files
authored
Merge pull request #81 from AlexWaygood/gen_markup-cache
2 parents a05d20b + 3140871 commit 9c86368

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

sphinxlint/rst.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- All constants are ALL_CAPS
55
- All compiled regexes are suffixed by _RE
66
"""
7+
from functools import lru_cache
78

89
import regex as re
910

@@ -151,6 +152,7 @@
151152
UNICODE_ALLOWED_AFTER_INLINE_MARKUP = r"\p{Pe}\p{Pi}\p{Pf}\p{Pd}\p{Po}"
152153

153154

155+
@lru_cache(maxsize=None)
154156
def inline_markup_gen(start_string, end_string, extra_allowed_before=""):
155157
"""Generate a regex matching an inline markup.
156158

0 commit comments

Comments
 (0)