mirror of
https://github.com/sphinx-doc/sphinx.git
synced 2025-02-25 18:55:22 -06:00
epub-validator doesn't allow # (and #top).
This commit is contained in:
@@ -188,6 +188,8 @@ class EpubBuilder(StandaloneHTMLBuilder):
|
||||
|
||||
# don't add links
|
||||
add_permalinks = False
|
||||
# don't use # as current path. ePub check reject it.
|
||||
allow_sharp_as_current_path = False
|
||||
# don't add sidebar etc.
|
||||
embedded = True
|
||||
# disable download role
|
||||
|
||||
@@ -82,6 +82,7 @@ class StandaloneHTMLBuilder(Builder):
|
||||
'image/gif', 'image/jpeg']
|
||||
searchindex_filename = 'searchindex.js'
|
||||
add_permalinks = True
|
||||
allow_sharp_as_current_path = True
|
||||
embedded = False # for things like HTML help or Qt help: suppresses sidebar
|
||||
search = True # for things like HTML help and Apple help: suppress search
|
||||
download_support = True # enable download role
|
||||
@@ -786,6 +787,8 @@ class StandaloneHTMLBuilder(Builder):
|
||||
elif not resource:
|
||||
otheruri = self.get_target_uri(otheruri)
|
||||
uri = relative_uri(baseuri, otheruri) or '#'
|
||||
if uri == '#' and not self.allow_sharp_as_current_path:
|
||||
uri = baseuri
|
||||
return uri
|
||||
ctx['pathto'] = pathto
|
||||
|
||||
|
||||
Reference in New Issue
Block a user