From fbb7f1d9b33b39e48b4bbe4107174c32f4397698 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Mon, 13 Jan 2025 11:31:28 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Minor=20fix=20for=20sphinx=208.2?= =?UTF-8?q?=20compat=20(#1013)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit closes #1010 --- .readthedocs.yml | 1 + myst_parser/mdit_to_docutils/base.py | 5 +++-- pyproject.toml | 1 + 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.readthedocs.yml b/.readthedocs.yml index f3a5e31c..cb68e005 100644 --- a/.readthedocs.yml +++ b/.readthedocs.yml @@ -14,5 +14,6 @@ python: - rtd sphinx: + configuration: docs/conf.py builder: html fail_on_warning: true diff --git a/myst_parser/mdit_to_docutils/base.py b/myst_parser/mdit_to_docutils/base.py index bdd15156..3778dd31 100644 --- a/myst_parser/mdit_to_docutils/base.py +++ b/myst_parser/mdit_to_docutils/base.py @@ -716,8 +716,9 @@ def render_fence(self, token: SyntaxTreeNode) -> None: if not name and self.sphinx_env is not None: # use the current highlight setting, via the ``highlight`` directive, # or ``highlight_language`` configuration. - name = self.sphinx_env.temp_data.get( - "highlight_language", self.sphinx_env.config.highlight_language + name = ( + self.sphinx_env.temp_data.get("highlight_language") + or self.sphinx_env.config.highlight_language ) lineno_start = 1 diff --git a/pyproject.toml b/pyproject.toml index e72f84a8..e97dff7f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -75,6 +75,7 @@ testing = [ "pytest-regressions", "pytest-param-files~=0.6.0", "sphinx-pytest", + "pygments<2.19", # TODO fix test regression with 2.19" ] testing-docutils = [ "pygments",