chiark / gitweb /
m.htmlsanity: actually add the highlight CSS class to inline code.
authorVladimír Vondruš <mosra@centrum.cz>
Mon, 11 Sep 2017 15:15:09 +0000 (17:15 +0200)
committerVladimír Vondruš <mosra@centrum.cz>
Thu, 14 Sep 2017 22:11:11 +0000 (00:11 +0200)
So I don't have to add it manually every time.

pelican-plugins/m/htmlsanity.py

index 18172d58f78d5286acdcd03de9255e7e4bbad653..a74aa1fc33e84c49411dcaa82842e4913a0f4626 100644 (file)
@@ -208,10 +208,10 @@ class SaneHtmlTranslator(HTMLTranslator):
         if 'code' in classes:
             # filter 'code' from class arguments
             node['classes'] = [cls for cls in classes if cls != 'code']
-            self.body.append(self.starttag(node, 'code', ''))
+            self.body.append(self.starttag(node, 'code', '', CLASS='highlight'))
             return
         self.body.append(
-            self.starttag(node, 'code', ''))
+            self.starttag(node, 'code', '', CLASS='highlight'))
         text = node.astext()
         # remove hard line breaks (except if in a parsed-literal block)
         if not isinstance(node.parent, nodes.literal_block):