[PATCH v4 16/16] md2html: change css name to not conflict with highlight

Andy Green andy at warmcat.com
Wed Jun 20 12:13:20 CEST 2018


md2html gets pygments to define the css for "highlight", making display
of the blame view fragile against pygments version.  On Fedora 28 /
python3-pygments-2.2.0-10.fc28.noarch, "highlight" gets redefined so
it no longer displays at the top of its parent.

This patch changes the css class name used by md2html to "md2html_highlight"
so there is no conflict with other definitions of "highlight".

Signed-off-by: Andy Green <andy at warmcat.com>
---
 filters/html-converters/md2html |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/filters/html-converters/md2html b/filters/html-converters/md2html
index 6f4f1b3..00cf73a 100755
--- a/filters/html-converters/md2html
+++ b/filters/html-converters/md2html
@@ -305,7 +305,7 @@ sys.stdout.write('''
     border: none;
     background: transparent;
 }
-.markdown-body .highlight pre, .markdown-body pre {
+.markdown-body .md2html_highlight pre, .markdown-body pre {
     background-color: #f8f8f8;
     border: 1px solid #ccc;
     font-size: 13px;
@@ -321,7 +321,7 @@ sys.stdout.write('''
     border: none;
 }
 ''')
-sys.stdout.write(HtmlFormatter(style='pastie').get_style_defs('.highlight'))
+sys.stdout.write(HtmlFormatter(style='pastie').get_style_defs('.md2html_highlight'))
 sys.stdout.write('''
 </style>   
 ''')
@@ -334,7 +334,7 @@ extensions = [
     "markdown.extensions.tables"
 ]
 extension_configs = {
-    "markdown.extensions.codehilite":{"css_class":"highlight"}
+    "markdown.extensions.codehilite":{"css_class":"md2html_highlight"}
 }
 
 if len(sys.argv) > 2:



More information about the CGit mailing list