From f6436004e9c9b2d095f6f83db0a44a3cf40c5b47 Mon Sep 17 00:00:00 2001 From: Chris Sewell Date: Tue, 14 Jun 2022 10:26:57 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20MAINTAIN:=20Minor=20fixes=20(#58?= =?UTF-8?q?5)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Improve integration with myst-nb --- myst_parser/mdit_to_docutils/base.py | 2 +- myst_parser/sphinx_ext/myst_refs.py | 6 +----- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/myst_parser/mdit_to_docutils/base.py b/myst_parser/mdit_to_docutils/base.py index 49c3fd22..ab720484 100644 --- a/myst_parser/mdit_to_docutils/base.py +++ b/myst_parser/mdit_to_docutils/base.py @@ -381,7 +381,7 @@ def add_line_and_source_path_r( """ for node in nodes: self.add_line_and_source_path(node, token) - for child in node.traverse(): + for child in findall(node)(): self.add_line_and_source_path(child, token) def update_section_level_state(self, section: nodes.section, level: int) -> None: diff --git a/myst_parser/sphinx_ext/myst_refs.py b/myst_parser/sphinx_ext/myst_refs.py index 9ba223d6..f3643459 100644 --- a/myst_parser/sphinx_ext/myst_refs.py +++ b/myst_parser/sphinx_ext/myst_refs.py @@ -151,11 +151,7 @@ def resolve_myst_ref( except NotImplementedError: # the domain doesn't yet support the new interface # we have to manually collect possible references (SLOW) - if not ( - getattr(domain, "__module__", "").startswith("sphinx.") - # TODO glue can be removed when myst-nb fixed - or "glue" in getattr(domain, "__module__", "") - ): + if not (getattr(domain, "__module__", "").startswith("sphinx.")): logger.warning( f"Domain '{domain.__module__}::{domain.name}' has not " "implemented a `resolve_any_xref` method [myst.domains]",