mirror of
https://github.com/zulip/zulip.git
synced 2025-11-04 22:13:26 +00:00
python: Elide unnecessary list wrappers.
Signed-off-by: Anders Kaseorg <anders@zulip.com>
This commit is contained in:
committed by
Tim Abbott
parent
eff0a73925
commit
2665a3ce2b
@@ -46,8 +46,8 @@ class NestedCodeBlocksRendererTreeProcessor(markdown.treeprocessors.Treeprocesso
|
||||
parent.tag == "p"
|
||||
and grandparent.tag == "li"
|
||||
and parent.text is None
|
||||
and len(list(parent)) == 1
|
||||
and len(list(parent.itertext())) == 1
|
||||
and len(parent) == 1
|
||||
and sum(1 for text in parent.itertext()) == 1
|
||||
):
|
||||
# if the parent (<p>) has no text, and no children,
|
||||
# that means that the <code> element inside is its
|
||||
|
||||
Reference in New Issue
Block a user