chiark / gitweb /
htmlsanity: render figure captions as <figcaption>.
authorVladimír Vondruš <mosra@centrum.cz>
Wed, 23 Aug 2017 15:48:48 +0000 (17:48 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 24 Aug 2017 11:16:27 +0000 (13:16 +0200)
pelican-plugins/m/htmlsanity.py

index 358d9ca4e55a269d499babfb8cef59033ec2f7ab..95e7eb2ad45696e32e70f5de278c4d8a26e98ca5 100644 (file)
@@ -297,6 +297,12 @@ class SaneHtmlTranslator(HTMLTranslator):
     def depart_figure(self, node):
         self.body.append('</figure>\n')
 
+    def visit_caption(self, node):
+        self.body.append(self.starttag(node, 'figcaption', ''))
+
+    def depart_caption(self, node):
+        self.body.append('</figcaption>\n')
+
     # Line blocks are <p> with lines separated using simple <br />. No need for
     # nested <div>s.
     def visit_line(self, node):