Fixes #892: Fix single-HTML builder misbehaving with the master document in a subdirectory.

This commit is contained in:
Georg Brandl 2012-03-10 19:24:03 +01:00
parent b21f7931fa
commit 17591ffe93
2 changed files with 8 additions and 2 deletions

View File

@ -48,6 +48,9 @@ Release 1.1.3 (in development)
* #870: Fix spurious KeyErrors when removing documents.
* #892: Fix single-HTML builder misbehaving with the master document in a
subdirectory.
Release 1.1.2 (Nov 1, 2011) -- 1.1.1 is a silly version number anyway!
======================================================================

View File

@ -698,9 +698,12 @@ class StandaloneHTMLBuilder(Builder):
ctx = self.globalcontext.copy()
# current_page_name is backwards compatibility
ctx['pagename'] = ctx['current_page_name'] = pagename
default_baseuri = self.get_target_uri(pagename)
# in the singlehtml builder, default_baseuri still contains an #anchor
# part, which relative_uri doesn't really like...
default_baseuri = default_baseuri.rsplit('#', 1)[0]
def pathto(otheruri, resource=False,
baseuri=self.get_target_uri(pagename)):
def pathto(otheruri, resource=False, baseuri=default_baseuri):
if resource and '://' in otheruri:
# allow non-local resources given by scheme
return otheruri