summaryrefslogtreecommitdiff
path: root/sphinx/util/docutils.py
diff options
context:
space:
mode:
authorTakeshi KOMIYA <i.tkomiya@gmail.com>2020-11-03 11:40:36 +0900
committerGitHub <noreply@github.com>2020-11-03 11:40:36 +0900
commitb93aa3137af650ea01f3a68bb14e822bffe81309 (patch)
treea65106dea736ef2c8b345ac333cd1e287aee17e3 /sphinx/util/docutils.py
parent93f6ffb62b8dc2cbd16f4bc9b7426e467fd4250c (diff)
parent9cd3e1a38925ee4db4b787ad81a2e3605aa5b15d (diff)
downloadsphinx-git-b93aa3137af650ea01f3a68bb14e822bffe81309.tar.gz
Merge pull request #8345 from sphinx-doc/8342_warning_for_unknown_domain
Fix #8342: Emit a warning if a unknown domain is given for directive or role
Diffstat (limited to 'sphinx/util/docutils.py')
-rw-r--r--sphinx/util/docutils.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/sphinx/util/docutils.py b/sphinx/util/docutils.py
index 161575cbd..8ca38bac2 100644
--- a/sphinx/util/docutils.py
+++ b/sphinx/util/docutils.py
@@ -28,6 +28,7 @@ from docutils.statemachine import StateMachine, State, StringList
from docutils.utils import Reporter, unescape
from sphinx.errors import SphinxError
+from sphinx.locale import _
from sphinx.util import logging
from sphinx.util.typing import RoleFunction
@@ -208,6 +209,8 @@ class sphinx_domains:
element = getattr(domain, type)(name)
if element is not None:
return element, []
+ else:
+ logger.warning(_('unknown directive or role name: %s:%s'), domain_name, name)
# else look in the default domain
else:
def_domain = self.env.temp_data.get('default_domain')