mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
Fix for r67038.
This commit is contained in:
@@ -194,9 +194,11 @@ class HTMLTranslator(BaseTranslator):
|
||||
if node.has_key('linenos'):
|
||||
linenos = node['linenos']
|
||||
highlighted = self.highlighter.highlight_block(node.rawsource, lang, linenos)
|
||||
starttag = self.starttag(node, 'div', suffix='')[:-1]
|
||||
self.body.append(starttag + highlighted[4:]) # skip '<div' and replace by
|
||||
# one possibly containing id attr
|
||||
starttag = self.starttag(node, 'div', suffix='')
|
||||
if starttag != '<div>':
|
||||
self.body.append(starttag + highlighted + '</div>\n')
|
||||
else:
|
||||
self.body.append(highlighted)
|
||||
raise nodes.SkipNode
|
||||
|
||||
def visit_doctest_block(self, node):
|
||||
|
||||
@@ -29,7 +29,7 @@ Date: 9 Mar 2007
|
||||
|
||||
from __future__ import generators
|
||||
|
||||
import sys, warnings, os, fnmatch, glob, shutil, codecs, md5
|
||||
import sys, warnings, os, fnmatch, glob, shutil, codecs
|
||||
|
||||
__version__ = '2.2'
|
||||
__all__ = ['path']
|
||||
@@ -760,23 +760,6 @@ class path(_base):
|
||||
finally:
|
||||
f.close()
|
||||
|
||||
def read_md5(self):
|
||||
""" Calculate the md5 hash for this file.
|
||||
|
||||
This reads through the entire file.
|
||||
"""
|
||||
f = self.open('rb')
|
||||
try:
|
||||
m = md5.new()
|
||||
while True:
|
||||
d = f.read(8192)
|
||||
if not d:
|
||||
break
|
||||
m.update(d)
|
||||
finally:
|
||||
f.close()
|
||||
return m.digest()
|
||||
|
||||
# --- Methods for querying the filesystem.
|
||||
|
||||
exists = os.path.exists
|
||||
|
||||
@@ -11,6 +11,11 @@ Testing various markup
|
||||
:author: Me
|
||||
:keywords: docs, sphinx
|
||||
|
||||
.. _label:
|
||||
|
||||
::
|
||||
|
||||
some code
|
||||
|
||||
Admonitions
|
||||
-----------
|
||||
|
||||
@@ -58,6 +58,7 @@ HTML_XPATH = {
|
||||
".//meta[@name='author'][@content='Me']": '',
|
||||
".//meta[@name='keywords'][@content='docs, sphinx']": '',
|
||||
".//a[@href='contents.html#ref1']": '',
|
||||
".//div[@id='label']": '',
|
||||
},
|
||||
'desc.html': {
|
||||
".//dt[@id='mod.Cls.meth1']": '',
|
||||
|
||||
Reference in New Issue
Block a user