summaryrefslogtreecommitdiff
path: root/sphinx/ext/mathbase.py
diff options
context:
space:
mode:
Diffstat (limited to 'sphinx/ext/mathbase.py')
-rw-r--r--sphinx/ext/mathbase.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/sphinx/ext/mathbase.py b/sphinx/ext/mathbase.py
index c9f993aeb..d021c60bd 100644
--- a/sphinx/ext/mathbase.py
+++ b/sphinx/ext/mathbase.py
@@ -71,7 +71,8 @@ class MathDirective(Directive):
node['docname'] = self.state.document.settings.env.docname
ret = [node]
node.line = self.lineno
- node.source = self.src
+ if hasattr(self, 'src'):
+ node.source = self.src
if node['label']:
tnode = nodes.target('', '', ids=['equation-' + node['label']])
self.state.document.note_explicit_target(tnode)