diff options
| author | shimizukawa <shimizukawa@gmail.com> | 2013-01-30 00:49:41 +0900 |
|---|---|---|
| committer | shimizukawa <shimizukawa@gmail.com> | 2013-01-30 00:49:41 +0900 |
| commit | e555c40ae830cf488ea0a841208d709cdfaddc82 (patch) | |
| tree | 04919a6a095bbaafb8e9a2b9461c0c60aedd296f | |
| parent | 04e38ec4c4d97499afc7c734dbd8cffdab771ce1 (diff) | |
| download | sphinx-e555c40ae830cf488ea0a841208d709cdfaddc82.tar.gz | |
fix source and line value for glossary term. refs #1090
| -rw-r--r-- | sphinx/domains/std.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/sphinx/domains/std.py b/sphinx/domains/std.py index 31db31db..011a12bf 100644 --- a/sphinx/domains/std.py +++ b/sphinx/domains/std.py @@ -22,7 +22,7 @@ from sphinx.locale import l_, _ from sphinx.domains import Domain, ObjType from sphinx.directives import ObjectDescription from sphinx.util import ws_re -from sphinx.util.nodes import clean_astext, make_refnode, set_source_info +from sphinx.util.nodes import clean_astext, make_refnode from sphinx.util.compat import Directive @@ -307,13 +307,17 @@ class Glossary(Directive): # add an index entry too indexnode = addnodes.index() indexnode['entries'] = [('single', termtext, new_id, 'main')] - termnodes.append(indexnode) - termnodes.extend(res[0]) - termnodes.append(addnodes.termsep()) + _termnodes = [] + _termnodes.append(indexnode) + _termnodes.extend(res[0]) + _termnodes.append(addnodes.termsep()) + for termnode in _termnodes: + termnode.source, termnode.line = source, lineno + termnodes.extend(_termnodes) # make a single "term" node with all the terms, separated by termsep # nodes (remove the dangling trailing separator) term = nodes.term('', '', *termnodes[:-1]) - set_source_info(self, term) + term.source, term.line = termnodes[0].source, termnodes[0].line term.rawsource = term.astext() term['ids'].extend(ids) term['names'].extend(ids) |
