Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Made fix for quote characters with SmartPants + parsed literal blocks…

… conditional on Sphinx version.

This hs been fixed upstream in releases >= 1.0.8 (issue 647.)

git-svn-id: http://code.djangoproject.com/svn/django/trunk@16952 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information...
commit b95c06d423a019151b44dde27bcb7ea1617b83a6 1 parent 6d7461f
@ramiro ramiro authored
Showing with 12 additions and 11 deletions.
  1. +12 −11 docs/_ext/djangodocs.py
View
23 docs/_ext/djangodocs.py
@@ -16,7 +16,7 @@
except ImportError:
json = None
-from sphinx import addnodes, roles
+from sphinx import addnodes, roles, __version__ as sphinx_ver
from sphinx.builders.html import StandaloneHTMLBuilder
from sphinx.writers.html import SmartyPantsHTMLTranslator
from sphinx.util.console import bold
@@ -139,16 +139,17 @@ def visit_desc_parameterlist(self, node):
def depart_desc_parameterlist(self, node):
self.body.append(')')
- #
- # Don't apply smartypants to literal blocks
- #
- def visit_literal_block(self, node):
- self.no_smarty += 1
- SmartyPantsHTMLTranslator.visit_literal_block(self, node)
-
- def depart_literal_block(self, node):
- SmartyPantsHTMLTranslator.depart_literal_block(self, node)
- self.no_smarty -= 1
+ if sphinx_ver < '1.0.8':
+ #
+ # Don't apply smartypants to literal blocks
+ #
+ def visit_literal_block(self, node):
+ self.no_smarty += 1
+ SmartyPantsHTMLTranslator.visit_literal_block(self, node)
+
+ def depart_literal_block(self, node):
+ SmartyPantsHTMLTranslator.depart_literal_block(self, node)
+ self.no_smarty -= 1
#
# Turn the "new in version" stuff (versionadded/versionchanged) into a
Please sign in to comment.
Something went wrong with that request. Please try again.