chiark / gitweb /
m.htmlsanity: don't rely on .m-transition, again.
authorVladimír Vondruš <mosra@centrum.cz>
Tue, 4 Jan 2022 19:00:56 +0000 (20:00 +0100)
committerVladimír Vondruš <mosra@centrum.cz>
Tue, 4 Jan 2022 19:42:40 +0000 (20:42 +0100)
Followup to 3f7b8501c98bfead4047f397a527e096ac75e26a. Was fixed in one
place but not in the other. Also add a clarifying comment.

plugins/m/htmlsanity.py

index 049cbc723d437689cb3c592592dc9fe424b48de2..554a495caf2a1bc990ca6e2c6aa2856290b73d53 100644 (file)
@@ -632,7 +632,8 @@ class SaneHtmlTranslator(HTMLTranslator):
     def depart_definition_list(self, node):
         self.body.append('</dl>\n')
 
-    # no class="docutils" in <hr>
+    # no class="docutils" in <hr>; if it's m.css .. transition:: directive
+    # (having children), put it in a <p> 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('</p>\n')
 
 class _SaneFieldBodyTranslator(SaneHtmlTranslator):