Skip to content

Commit

Permalink
[1.0.X] Fixed #8971: correctly reverse urls in admindocs reST roles. …
Browse files Browse the repository at this point in the history
…Thanks, mitsuhiko. Backport of [10683] from trunk.

git-svn-id: http://code.djangoproject.com/svn/django/branches/releases/1.0.X@10685 bcc190cf-cafb-0310-a4f2-bffc1f526a37
  • Loading branch information
jacobian committed May 7, 2009
1 parent fc15d69 commit 643e914
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions django/contrib/admindocs/utils.py
Expand Up @@ -4,6 +4,7 @@
from email.Parser import HeaderParser
from email.Errors import HeaderParseError
from django.utils.safestring import mark_safe
from django.core.urlresolvers import reverse
try:
import docutils.core
import docutils.nodes
Expand Down Expand Up @@ -52,15 +53,15 @@ def parse_docstring(docstring):
body = "\n\n".join(parts[1:])
return title, body, metadata

def parse_rst(text, default_reference_context, thing_being_parsed=None, link_base='../..'):
def parse_rst(text, default_reference_context, thing_being_parsed=None):
"""
Convert the string from reST to an XHTML fragment.
"""
overrides = {
'doctitle_xform' : True,
'inital_header_level' : 3,
"default_reference_context" : default_reference_context,
"link_base" : link_base,
"link_base" : reverse('django-admindocs-docroot').rstrip('/')
}
if thing_being_parsed:
thing_being_parsed = "<%s>" % thing_being_parsed
Expand Down

0 comments on commit 643e914

Please sign in to comment.