diff --git a/zerver/lib/markdown/__init__.py b/zerver/lib/markdown/__init__.py index 506d80cf53..d51af110b4 100644 --- a/zerver/lib/markdown/__init__.py +++ b/zerver/lib/markdown/__init__.py @@ -2282,15 +2282,15 @@ class ZulipMarkdown(markdown.Markdown): reg.register(UnicodeEmoji(UNICODE_EMOJI_RE), "unicodeemoji", 0) return reg - def register_linkifiers(self, inlinePatterns: markdown.util.Registry) -> markdown.util.Registry: + def register_linkifiers(self, registry: markdown.util.Registry) -> markdown.util.Registry: for linkifier in self.linkifiers: pattern = linkifier["pattern"] - inlinePatterns.register( + registry.register( LinkifierPattern(pattern, linkifier["url_format"], self), f"linkifiers/{pattern}", 45, ) - return inlinePatterns + return registry def build_treeprocessors(self) -> markdown.util.Registry: # Here we build all the processors from upstream, plus a few of our own. diff --git a/zerver/openapi/markdown_extension.py b/zerver/openapi/markdown_extension.py index bcf3d96a1f..3cbdfb6ea1 100644 --- a/zerver/openapi/markdown_extension.py +++ b/zerver/openapi/markdown_extension.py @@ -437,11 +437,11 @@ class APIMarkdownExtension(Extension): class BasePreprocessor(Preprocessor): def __init__( - self, REGEXP: Pattern[str], md: markdown.Markdown, config: Mapping[str, Any] + self, regexp: Pattern[str], md: markdown.Markdown, config: Mapping[str, Any] ) -> None: super().__init__(md) self.api_url = config["api_url"] - self.REGEXP = REGEXP + self.REGEXP = regexp def run(self, lines: List[str]) -> List[str]: done = False