Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate <script id="documentation_options"> with Sphinx 4 #1159

Closed
andersk opened this issue Jun 7, 2021 · 2 comments
Closed

Duplicate <script id="documentation_options"> with Sphinx 4 #1159

andersk opened this issue Jun 7, 2021 · 2 comments
Labels
Bug A bug Needed: replication Bug replication is required

Comments

@andersk
Copy link
Contributor

andersk commented Jun 7, 2021

Problem

Sphinx 4.0.0 changed the way the documentation_options script is inserted, such that we’re now inserting an extra copy of it. This results in invalid HTML (duplicate id).

Reproducible Project

This is reproducible with a totally empty project:

$ pip install Sphinx sphinx_rtd_theme
Collecting Sphinx
[…]
Successfully installed Jinja2-3.0.1 MarkupSafe-2.0.1 Pygments-2.9.0 Sphinx-4.0.2 alabaster-0.7.12 babel-2.9.1 certifi-2021.5.30 chardet-4.0.0 docutils-0.17.1 idna-2.10 imagesize-1.2.0 packaging-20.9 pyparsing-2.4.7 pytz-2021.1 requests-2.25.1 snowballstemmer-2.1.0 sphinx-rtd-theme-0.5.2 sphinxcontrib-applehelp-1.0.2 sphinxcontrib-devhelp-1.0.2 sphinxcontrib-htmlhelp-2.0.0 sphinxcontrib-jsmath-1.0.1 sphinxcontrib-qthelp-1.0.3 sphinxcontrib-serializinghtml-1.1.5 urllib3-1.26.5
$ mkdir docs
$ touch docs/index.rst
$ sphinx-build -C -D html_theme=sphinx_rtd_theme docs build
Running Sphinx v4.0.2
[…]
The HTML pages are in build.

Error Logs/Results

$ grep documentation_options build/index.html
      <script type="text/javascript" id="documentation_options" data-url_root="./" src="_static/documentation_options.js"></script>
        <script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>

Expected Results

Only one copy of <script id="documentation_options"> should be present.

Environment Info

  • Python Version: 3.8.9
  • Sphinx Version: 4.0.2
  • RTD Theme Version: 0.5.2
@andersk andersk added Bug A bug Needed: replication Bug replication is required labels Jun 7, 2021
@Blendify
Copy link
Member

Blendify commented Jun 8, 2021

This will be fixed with #1123

@Blendify
Copy link
Member

This has been fixed with 380647d

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug Needed: replication Bug replication is required
Projects
None yet
Development

No branches or pull requests

2 participants