Skip to content

Commit 4314764

Browse files
committed
Fix for docutils 0.19
1 parent 811da79 commit 4314764

File tree

1 file changed

+7
-2
lines changed
  • myst_parser/mdit_to_docutils

1 file changed

+7
-2
lines changed

myst_parser/mdit_to_docutils/base.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1391,11 +1391,16 @@ def html_meta_to_nodes(
13911391
return []
13921392

13931393
try:
1394+
# if sphinx available
13941395
from sphinx.addnodes import meta as meta_cls
13951396
except ImportError:
1396-
from docutils.parsers.rst.directives.html import MetaBody
1397+
try:
1398+
# docutils >= 0.19
1399+
meta_cls = nodes.meta # type: ignore
1400+
except AttributeError:
1401+
from docutils.parsers.rst.directives.html import MetaBody
13971402

1398-
meta_cls = MetaBody.meta # type: ignore
1403+
meta_cls = MetaBody.meta # type: ignore
13991404

14001405
output = []
14011406

0 commit comments

Comments
 (0)