From 34c01065ce968ed650bd24c3d4943b4e22ffed2d Mon Sep 17 00:00:00 2001 From: turky Date: Thu, 8 Feb 2024 14:50:01 +0900 Subject: [PATCH] html builder omit query component when builder name start with 'epub' --- sphinx/builders/html/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sphinx/builders/html/__init__.py b/sphinx/builders/html/__init__.py index d85539bf648..cf76d432b02 100644 --- a/sphinx/builders/html/__init__.py +++ b/sphinx/builders/html/__init__.py @@ -1052,7 +1052,7 @@ def css_tag(css: _CascadingStyleSheet) -> str: if value is not None] uri = pathto(os.fspath(css.filename), resource=True) # the EPUB format does not allow the use of query components - if self.name != 'epub': + if not self.name.startswith('epub'): if checksum := _file_checksum(outdir, css.filename): uri += f'?v={checksum}' return f'' @@ -1082,7 +1082,7 @@ def js_tag(js: _JavaScript | str) -> str: # https://github.com/sphinx-doc/sphinx/issues/11658 pass # the EPUB format does not allow the use of query components - elif self.name != 'epub': + elif not self.name.startswith('epub'): if checksum := _file_checksum(outdir, js.filename): uri += f'?v={checksum}' if attrs: