#49 Fix rendering of double colons in Sphinx roles with docutils 0.18+
Merged a year ago by ksurma. Opened a year ago by ksurma.
rpms/ ksurma/python-sphinx 5.0.3  into  f37

@@ -0,0 +1,27 @@ 

+ From 4b482334a28d0706ba4bd68d51be9c041c135798 Mon Sep 17 00:00:00 2001

+ From: =?UTF-8?q?Jean-Fran=C3=A7ois=20B?=

+  <2589111+jfbu@users.noreply.github.com>

+ Date: Sat, 25 Jun 2022 21:10:34 +0200

+ Subject: [PATCH] Fix duplicated field term colons for Docutils 0.18+ (#10595)

+ 

+ Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>

+ ---

+  sphinx/themes/basic/static/basic.css_t | 2 ++

+  2 files changed, 4 insertions(+)

+ 

+ diff --git a/sphinx/themes/basic/static/basic.css_t b/sphinx/themes/basic/static/basic.css_t

+ index d8f3fe74626..47f802dc4e7 100644

+ --- a/sphinx/themes/basic/static/basic.css_t

+ +++ b/sphinx/themes/basic/static/basic.css_t

+ @@ -686,9 +686,11 @@ dl.field-list > dt {

+      padding-right: 5px;

+  }

+  

+ +{%- if docutils_version_info[:2] < (0, 18) %}

+  dl.field-list > dt:after {

+      content: ":";

+  }

+ +{% endif %}

+  

+  dl.field-list > dd {

+      padding-left: 0.5em;

file modified
+11 -1
@@ -28,7 +28,7 @@ 

  #global     prerel ...

  %global     upstream_version %{general_version}%{?prerel}

  Version:    %{general_version}%{?prerel:~%{prerel}}

- Release:    2%{?dist}

+ Release:    3%{?dist}

  Epoch:      1

  Summary:    Python documentation generator

  
@@ -45,6 +45,12 @@ 

  # which causes that test to fail.

  Patch1:     sphinx-test_theming.diff

  

+ # Fix double colon rendering in Sphinx roles

+ # This was supposed to get to Sphinx 5.0.3 but it was never released

+ # Backporting per request: https://bugzilla.redhat.com/show_bug.cgi?id=2166116

+ # Upstream: https://github.com/sphinx-doc/sphinx/issues/10594

+ Patch2:     Fix-double-colons-with-docutils-0.18.patch

+ 

  BuildArch:     noarch

  

  BuildRequires: make
@@ -364,6 +370,10 @@ 

  

  

  %changelog

+ * Wed Feb 01 2023 Karolina Surma <ksurma@redhat.com> - 1:5.0.2-3

+ - Backport a fix for rendering double colons in Sphinx roles

+ - Fixes: rhbz#2166116

+ 

  * Fri Jul 22 2022 Fedora Release Engineering <releng@fedoraproject.org> - 1:5.0.2-2

  - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild

  

This is a backport from Sphinx to enable correct rendering of colons with docutils 0.18 (which are in F37).

Build succeeded.

Seems quite straightforward but I haven't tested if it actually works. Have you?

Yes, I tried the minimal reproducer from the upstream issue: https://github.com/sphinx-doc/sphinx/issues/10594
Our current Sphinx in F37 renders double colons, the scratch build produces output with one colon (as desired).

Awsome, thanks. Ship it then.

Pull-Request has been merged by ksurma

a year ago