Ticket #8971: 8971-reverse.patch

File 8971-reverse.patch, 1.1 KB (added by Armin Ronacher, 16 years ago)

reverses the url to the root properly

  • django/contrib/admindocs/utils.py

     
    44from email.Parser import HeaderParser
    55from email.Errors import HeaderParseError
    66from django.utils.safestring import mark_safe
     7from django.core.urlresolvers import reverse
    78try:
    89    import docutils.core
    910    import docutils.nodes
     
    5253                body = "\n\n".join(parts[1:])
    5354    return title, body, metadata
    5455
    55 def parse_rst(text, default_reference_context, thing_being_parsed=None, link_base='../..'):
     56def parse_rst(text, default_reference_context, thing_being_parsed=None):
    5657    """
    5758    Convert the string from reST to an XHTML fragment.
    5859    """
     
    6061        'doctitle_xform' : True,
    6162        'inital_header_level' : 3,
    6263        "default_reference_context" : default_reference_context,
    63         "link_base" : link_base,
     64        "link_base" : reverse('django-admindocs-docroot').rstrip('/')
    6465    }
    6566    if thing_being_parsed:
    6667        thing_being_parsed = "<%s>" % thing_being_parsed
Back to Top