diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index b3fcdb61..b0463362 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -70,15 +70,15 @@ jobs: strategy: fail-fast: false matrix: - docutils-version: ["0.17", "0.18", "0.19", "0.20"] + docutils-version: ["0.18", "0.19", "0.20", "0.21"] steps: - name: Checkout source uses: actions/checkout@v4 - - name: Set up Python 3.8 + - name: Set up Python 3.9 uses: actions/setup-python@v5 with: - python-version: "3.8" + python-version: "3.9" - name: Install setup run: | python -m pip install --upgrade pip diff --git a/myst_parser/mdit_to_docutils/base.py b/myst_parser/mdit_to_docutils/base.py index 4733dead..e604449b 100644 --- a/myst_parser/mdit_to_docutils/base.py +++ b/myst_parser/mdit_to_docutils/base.py @@ -1918,19 +1918,11 @@ def html_meta_to_nodes( if not data: return [] - try: - meta_cls = nodes.meta - except AttributeError: - # docutils-0.17 or older - from docutils.parsers.rst.directives.html import MetaBody - - meta_cls = MetaBody.meta - output = [] for key, value in data.items(): content = str(value or "") - meta_node = meta_cls(content) + meta_node = nodes.meta(content) meta_node.source = document["source"] meta_node.line = line meta_node["content"] = content diff --git a/pyproject.toml b/pyproject.toml index 27ec721f..01f5816d 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -35,7 +35,7 @@ keywords = [ ] requires-python = ">=3.8" dependencies = [ - "docutils>=0.16,<0.21", + "docutils>=0.18,<0.22", "jinja2", # required for substitutions, but let sphinx choose version "markdown-it-py~=3.0", "mdit-py-plugins~=0.4", diff --git a/tests/test_sphinx/test_sphinx_builds.py b/tests/test_sphinx/test_sphinx_builds.py index b4e7c10d..7e6b13a2 100644 --- a/tests/test_sphinx/test_sphinx_builds.py +++ b/tests/test_sphinx/test_sphinx_builds.py @@ -1,11 +1,6 @@ """Uses sphinx's pytest fixture to run builds. see conftest.py for fixture usage - -NOTE: sphinx 3 & 4 regress against different output files, -the major difference being sphinx 4 uses docutils 0.17, -which uses semantic HTML tags -(e.g. converting `
` to `
`) """ from __future__ import annotations