mirror of
https://codeberg.org/openpgp/notes.git
synced 2024-11-30 03:22:06 +01:00
Add local copy of upstreamed sphinx patch for CSS issues with EPUBs
The patch fixes https://github.com/sphinx-doc/sphinx/issues/11598 for sphinx >= 7.2.0 Signed-off-by: David Runge <dave@sleepmap.de>
This commit is contained in:
parent
57f62222d2
commit
ccddbe4204
1 changed files with 26 additions and 0 deletions
26
book/patches/sphinx-11766.patch
Normal file
26
book/patches/sphinx-11766.patch
Normal file
|
@ -0,0 +1,26 @@
|
||||||
|
diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py
|
||||||
|
index 85067be0178..91d3647597c 100644
|
||||||
|
--- a/sphinx/builders/html/__init__.py
|
||||||
|
+++ b/sphinx/builders/html/__init__.py
|
||||||
|
@@ -1061,7 +1061,9 @@ def css_tag(css: _CascadingStyleSheet) -> str:
|
||||||
|
attrs.append(f'{key}="{html.escape(value, quote=True)}"')
|
||||||
|
uri = pathto(os.fspath(css.filename), resource=True)
|
||||||
|
if checksum := _file_checksum(outdir, css.filename):
|
||||||
|
- uri += f'?v={checksum}'
|
||||||
|
+ # the EPUB format does not allow the use of query components
|
||||||
|
+ if self.name != 'epub':
|
||||||
|
+ uri += f'?v={checksum}'
|
||||||
|
return f'<link {" ".join(sorted(attrs))} href="{uri}" />'
|
||||||
|
|
||||||
|
ctx['css_tag'] = css_tag
|
||||||
|
@@ -1092,7 +1094,9 @@ def js_tag(js: _JavaScript | str) -> str:
|
||||||
|
# https://github.com/sphinx-doc/sphinx/issues/11658
|
||||||
|
pass
|
||||||
|
elif checksum := _file_checksum(outdir, js.filename):
|
||||||
|
- uri += f'?v={checksum}'
|
||||||
|
+ # the EPUB format does not allow the use of query components
|
||||||
|
+ if self.name != 'epub':
|
||||||
|
+ uri += f'?v={checksum}'
|
||||||
|
if attrs:
|
||||||
|
return f'<script {" ".join(sorted(attrs))} src="{uri}"></script>'
|
||||||
|
return f'<script src="{uri}"></script>'
|
Loading…
Reference in a new issue