From: Vladimír Vondruš Date: Tue, 4 Jan 2022 19:00:56 +0000 (+0100) Subject: m.htmlsanity: don't rely on .m-transition, again. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=941ea90fe952f7f2b195aada2e39d0482261e1fe;p=blog.git m.htmlsanity: don't rely on .m-transition, again. Followup to 3f7b8501c98bfead4047f397a527e096ac75e26a. Was fixed in one place but not in the other. Also add a clarifying comment. --- diff --git a/plugins/m/htmlsanity.py b/plugins/m/htmlsanity.py index 049cbc72..554a495c 100644 --- a/plugins/m/htmlsanity.py +++ b/plugins/m/htmlsanity.py @@ -632,7 +632,8 @@ class SaneHtmlTranslator(HTMLTranslator): def depart_definition_list(self, node): self.body.append('\n') - # no class="docutils" in
+ # no class="docutils" in
; if it's m.css .. transition:: directive + # (having children), put it in a

instead def visit_transition(self, node): if len(node.children) > 0: self.body.append(self.starttag(node, 'p', '')) @@ -640,7 +641,7 @@ class SaneHtmlTranslator(HTMLTranslator): self.body.append(self.emptytag(node, 'hr')) def depart_transition(self, node): - if 'm-transition' in node['classes']: + if len(node.children) > 0: self.body.append('

\n') class _SaneFieldBodyTranslator(SaneHtmlTranslator):