summaryrefslogtreecommitdiff
path: root/sphinx/util/rst.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/util/rst.py')
-rw-r--r--sphinx/util/rst.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/sphinx/util/rst.py b/sphinx/util/rst.py
index a59b2b07e..8b8aca9ea 100644
--- a/sphinx/util/rst.py
+++ b/sphinx/util/rst.py
@@ -18,6 +18,7 @@ from docutils.parsers.rst.languages import en as english
from docutils.utils import Reporter
from sphinx.locale import __
+from sphinx.util import docutils
from sphinx.util import logging
if False:
@@ -43,10 +44,10 @@ def default_role(docname, name):
dummy_reporter = Reporter('', 4, 4)
role_fn, _ = roles.role(name, english, 0, dummy_reporter)
if role_fn:
- roles._roles[''] = role_fn
+ docutils.register_role('', role_fn)
else:
logger.warning(__('default role %s not found'), name, location=docname)
yield
- roles._roles.pop('', None) # if a document has set a local default role
+ docutils.unregister_role('')