mirror of
https://github.com/zulip/zulip.git
synced 2025-11-10 08:56:10 +00:00
mypy: Enable new error explicit-override.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Anders Kaseorg
parent
d257002ad8
commit
a50eb2e809
@@ -4,11 +4,13 @@ from xml.etree.ElementTree import Element
|
||||
import markdown
|
||||
from django.contrib.staticfiles.storage import staticfiles_storage
|
||||
from markdown.extensions import Extension
|
||||
from typing_extensions import override
|
||||
|
||||
from zerver.lib.markdown.priorities import PREPROCESSOR_PRIORITES
|
||||
|
||||
|
||||
class MarkdownStaticImagesGenerator(Extension):
|
||||
@override
|
||||
def extendMarkdown(self, md: markdown.Markdown) -> None:
|
||||
md.treeprocessors.register(
|
||||
StaticImageProcessor(md),
|
||||
@@ -22,6 +24,7 @@ class StaticImageProcessor(markdown.treeprocessors.Treeprocessor):
|
||||
Rewrite img tags which refer to /static/ to use staticfiles
|
||||
"""
|
||||
|
||||
@override
|
||||
def run(self, root: Element) -> None:
|
||||
for img in root.iter("img"):
|
||||
url = img.get("src")
|
||||
|
||||
Reference in New Issue
Block a user