mirror of
https://github.com/zulip/zulip.git
synced 2025-11-18 12:54:58 +00:00
bugdown: Fix ResultWithFamily typing.
It needs to be a full class because a generic NamedTuple doesn’t work in Python 3.6. Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
2df183142c
commit
6aaeab75bc
@@ -33,8 +33,8 @@ class NestedCodeBlocksRendererTreeProcessor(markdown.treeprocessors.Treeprocesso
|
||||
return None
|
||||
|
||||
def get_nested_code_blocks(
|
||||
self, code_tags: List[ResultWithFamily]
|
||||
) -> List[ResultWithFamily]:
|
||||
self, code_tags: List[ResultWithFamily[Tuple[str, Optional[str]]]]
|
||||
) -> List[ResultWithFamily[Tuple[str, Optional[str]]]]:
|
||||
nested_code_blocks = []
|
||||
for code_tag in code_tags:
|
||||
parent: Any = code_tag.family.parent
|
||||
@@ -49,7 +49,7 @@ class NestedCodeBlocksRendererTreeProcessor(markdown.treeprocessors.Treeprocesso
|
||||
|
||||
return nested_code_blocks
|
||||
|
||||
def get_codehilite_block(self, code_block_text: str) -> Element:
|
||||
def get_codehilite_block(self, code_block_text: Optional[str]) -> Element:
|
||||
div = markdown.util.etree.Element("div")
|
||||
div.set("class", "codehilite")
|
||||
pre = markdown.util.etree.SubElement(div, "pre")
|
||||
|
||||
Reference in New Issue
Block a user