From 3f456cedeea9a7aee4ce628ef047149dbc054254 Mon Sep 17 00:00:00 2001 From: Ng Zhi An Date: Sun, 2 Nov 2014 18:17:11 -0500 Subject: [PATCH] Fix #183: Don't add classes to code blocks Previously, MkDocs will add classes to the
 blocks generated
from the md file to allow for the prettify library to work its magic.
This commit moves the translation into base.js under mkdocs, so now the
theme handles the prettify instead of assuming in the build process.
This allows users to use other libraries, such as highlight.js.
---
 mkdocs/build.py                 | 2 --
 mkdocs/themes/mkdocs/js/base.js | 1 +
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/mkdocs/build.py b/mkdocs/build.py
index 8d3dbab0..2aedc8eb 100644
--- a/mkdocs/build.py
+++ b/mkdocs/build.py
@@ -83,8 +83,6 @@ def post_process_html(html_content, nav=None):
     img_sub = PathToURL('src="%s"', nav)
     html_content = re.sub(r'src="([^"]*)"', img_sub, html_content)
 
-    html_content = html_content.replace('
', '
')
-
     return html_content
 
 
diff --git a/mkdocs/themes/mkdocs/js/base.js b/mkdocs/themes/mkdocs/js/base.js
index c99cce72..9c172b0b 100644
--- a/mkdocs/themes/mkdocs/js/base.js
+++ b/mkdocs/themes/mkdocs/js/base.js
@@ -1,6 +1,7 @@
 
 /* Prettyify */
 $( document ).ready(function() {
+    $('pre code').parent().addClass('prettyprint well')
     prettyPrint();
 });