From: Vladimír Vondruš Date: Mon, 11 Sep 2017 15:15:09 +0000 (+0200) Subject: m.htmlsanity: actually add the highlight CSS class to inline code. X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~cjwatson/git?a=commitdiff_plain;h=e43caf3189e2a05d43f5a81bc93c521249b08a36;p=blog.git m.htmlsanity: actually add the highlight CSS class to inline code. So I don't have to add it manually every time. --- diff --git a/pelican-plugins/m/htmlsanity.py b/pelican-plugins/m/htmlsanity.py index 18172d58..a74aa1fc 100644 --- a/pelican-plugins/m/htmlsanity.py +++ b/pelican-plugins/m/htmlsanity.py @@ -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):