mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 05:53:43 +00:00
fenced_code: Optimize FENCE_RE to fix cubic worst-case complexity.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Alex Vandiver
parent
dea935f26f
commit
162e9d6c0b
@@ -167,7 +167,7 @@ def fix_spoilers_in_text(content: str, language: str) -> str:
|
||||
m = FENCE_RE.match(line)
|
||||
if m:
|
||||
fence = m.group("fence")
|
||||
lang = m.group("lang")
|
||||
lang: Optional[str] = m.group("lang")
|
||||
if lang == "spoiler":
|
||||
open_fence = fence
|
||||
output.append(line)
|
||||
|
||||
Reference in New Issue
Block a user