dh_sphinxdoc fails to parse search.html generated file

Bug #2074525 reported by Miriam España Acebal
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Sphinx
Fix Released
Unknown
sphinx (Ubuntu)
New
Undecided
Miriam España Acebal

Bug Description

Since sphinx (7.3.7-1), when introduced the following change

+ * dh_sphinxdoc: Support loading searchindex.js with defer="defer"

implemented in this way:

diff -Nru sphinx-7.2.6/debian/dh-sphinxdoc/dh_sphinxdoc sphinx-7.3.7/debian/dh-sphinxdoc/dh_sphinxdoc
--- sphinx-7.2.6/debian/dh-sphinxdoc/dh_sphinxdoc 2024-06-16 14:34:33.000000000 +0000
+++ sphinx-7.3.7/debian/dh-sphinxdoc/dh_sphinxdoc 2024-07-03 07:18:22.000000000 +0000
@@ -290,7 +290,7 @@
         }
     }
     defined $documentation_options or error("DOCUMENTATION_OPTIONS not found");
- my $loads_searchindex = $search =~ m{<script(?: type="text/javascript")? src="[^"]*searchindex.js\s?"(?: defer)?>};
+ my $loads_searchindex = $search =~ m{<script(?: type="text/javascript")? src="[^"]*searchindex.js\s?"(?: defer(?:="defer"))?>};
     unless ($loads_searchindex)
     {
         # old style, used before Sphinx 2.0

if a generated search.html file has only defer when loading searchindex.js, e. g.:

        <script type="text/javascript" src="searchindex.js" defer></script>

dh_sphinxdoc fails with:

dh_sphinxdoc: error: <doc_path>/search.html does not load searchindex.js.

It has been seen in the mako package, preventing its build [1]

https://launchpadlibrarian.net/741379311/buildlog_ubuntu-oracular-amd64.mako_1.3.5-1.1_BUILDING.txt.gz

Revision history for this message
Miriam España Acebal (mirespace) wrote :

I'm submitting a fix for the regex expression in Salsa.

Changed in sphinx (Ubuntu):
assignee: nobody → Miriam España Acebal (mirespace)
Changed in sphinx:
status: Unknown → New
Revision history for this message
Miriam España Acebal (mirespace) wrote :
Changed in sphinx:
status: New → Unknown
Changed in sphinx:
status: Unknown → Fix Committed
Changed in sphinx:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.