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

Sphinx 5.0+ prints double colons for roles #10594

Closed
xqt opened this issue Jun 23, 2022 · 3 comments
Closed

Sphinx 5.0+ prints double colons for roles #10594

xqt opened this issue Jun 23, 2022 · 3 comments

Comments

@xqt
Copy link

xqt commented Jun 23, 2022

Describe the bug

For examle:
:1: Foo
is renderend as
1: Foo
with Sphinx 4.5
https://doc.wikimedia.org/pywikibot/stable/library_usage.html

whereas Sphinx 5.0+ renders
1:: Foo

https://doc.wikimedia.org/pywikibot/master/library_usage.html

How to Reproduce

Other examples with variables and parameters
Sphinx 4.5 (single quotes after Variables, Parameters, Return type) like:
Variables: summary_key - Edit summary message key
https://doc.wikimedia.org/pywikibot/stable/scripts_ref/scripts.html#module-scripts.basic

Sphinx 5.02 (doible quotes after Variables, Parameters, Return type) like:
Variables:: summary_key - Edit summary message key
https://doc.wikimedia.org/pywikibot/master/scripts_ref/scripts.html#module-scripts.basic

Expected behavior

Single quotes are expected as in Sphinx 4.5

Your project

See "Show Source" of the given links above.

Screenshots

Sphinx 4.5
image

Sphinx 5.0.2
image

OS

Linux

Python version

Python 3.7

Sphinx version

4.5.0 vs. 5.0.2

Sphinx extensions

'sphinx.ext.autodoc', 'sphinx.ext.autosectionlabel', 'sphinx.ext.extlinks', 'sphinx.ext.todo', 'sphinx.ext.viewcode', 'sphinx.ext.autosummary', 'sphinx.ext.napoleon',

Extra tools

No response

Additional context

No response

@xqt xqt added the type:bug label Jun 23, 2022
@jfbu jfbu added the docutils Tags upstream Docutils issues label Jun 24, 2022
@jfbu
Copy link
Contributor

jfbu commented Jun 24, 2022

This is not a Sphinx change per se, I can reproduce it with Sphinx 4.2.0, but is impacted by Docutils 0.18.

Try pip install docutils==0.17.1.

Minimal example:

Welcome to FOO's documentation!
===============================

test
----

:1: hello

:2: world

@jfbu
Copy link
Contributor

jfbu commented Jun 24, 2022

From Docutils 0.18 release notes:

Write footnote brackets and field term colons to HTML, so that they are present also without CSS and when copying text.

Our basic.css does

dl.field-list > dt:after {
    content: ":";
}

but there is already since DocUtils 0.18 a <span class="colon">:</span>.

Adding

dl.field-list  .colon {
    display: none;
}

to basic.css appears to fix the problem in a way which should not depend on Docutils version. Assuming a colon class was not used by extensions etc....

ping @AA-Turner for advice. Is there a potential issue with footnote brackets? I have not followed episodes of Sphinx compatibitility patches for Docutils 0.18.

jfbu added a commit to jfbu/sphinx that referenced this issue Jun 25, 2022
@jfbu jfbu added html theme and removed docutils Tags upstream Docutils issues labels Jun 25, 2022
@jfbu jfbu added this to the 5.0.3 milestone Jun 25, 2022
@AA-Turner
Copy link
Member

Fixed by #10595

A

wmfgerrit pushed a commit to wikimedia/pywikibot that referenced this issue Jun 26, 2022
see: sphinx-doc/sphinx#10594

Change-Id: I20a9cac918a8d9c0ea197ae6e994dbde304674b7
tillahoffmann added a commit to tillahoffmann/doit_interface that referenced this issue Jul 6, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants