@@ -1051,8 +1051,10 @@ def css_tag(css: _CascadingStyleSheet) -> str:
10511051 for key , value in css .attributes .items ()
10521052 if value is not None ]
10531053 uri = pathto (os .fspath (css .filename ), resource = True )
1054- if checksum := _file_checksum (outdir , css .filename ):
1055- uri += f'?v={ checksum } '
1054+ # the EPUB format does not allow the use of query components
1055+ if self .name != 'epub' :
1056+ if checksum := _file_checksum (outdir , css .filename ):
1057+ uri += f'?v={ checksum } '
10561058 return f'<link { " " .join (sorted (attrs ))} href="{ uri } " />'
10571059
10581060 ctx ['css_tag' ] = css_tag
@@ -1079,8 +1081,10 @@ def js_tag(js: _JavaScript | str) -> str:
10791081 # https://docs.mathjax.org/en/v2.7-latest/configuration.html#considerations-for-using-combined-configuration-files
10801082 # https://github.com/sphinx-doc/sphinx/issues/11658
10811083 pass
1082- elif checksum := _file_checksum (outdir , js .filename ):
1083- uri += f'?v={ checksum } '
1084+ # the EPUB format does not allow the use of query components
1085+ elif self .name != 'epub' :
1086+ if checksum := _file_checksum (outdir , js .filename ):
1087+ uri += f'?v={ checksum } '
10841088 if attrs :
10851089 return f'<script { " " .join (sorted (attrs ))} src="{ uri } "></script>'
10861090 return f'<script src="{ uri } "></script>'
0 commit comments