mirror of
https://github.com/mkdocs/mkdocs.git
synced 2026-03-27 09:58:31 +07:00
Fix #183: Don't add classes to code blocks
Previously, MkDocs will add classes to the <pre><code> 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.
This commit is contained in:
@@ -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('<pre>', '<pre class="prettyprint well">')
|
||||
|
||||
return html_content
|
||||
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
|
||||
/* Prettyify */
|
||||
$( document ).ready(function() {
|
||||
$('pre code').parent().addClass('prettyprint well')
|
||||
prettyPrint();
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user