summaryrefslogtreecommitdiff
path: root/sphinx/transforms.py
diff options
context:
space:
mode:
authorshimizukawa <shimizukawa@gmail.com>2016-02-13 17:51:44 +0900
committershimizukawa <shimizukawa@gmail.com>2016-02-14 15:11:06 +0900
commit804e866404fcc1827f86f7aa937ecf6379b5ec6e (patch)
tree81c7ae6441a3b774a9e15e4e56e979bf251775c0 /sphinx/transforms.py
parentb0897a47c4cdb8a952e47bcd122cde36c246ad03 (diff)
downloadsphinx-git-804e866404fcc1827f86f7aa937ecf6379b5ec6e.tar.gz
Now term nodes in a glossary directive are wrapped with termset node to handle multiple term correctly.
Fix #2251; Line breaks in .rst files are transferred to .pot files in a wrong way.
Diffstat (limited to 'sphinx/transforms.py')
-rw-r--r--sphinx/transforms.py15
1 files changed, 2 insertions, 13 deletions
diff --git a/sphinx/transforms.py b/sphinx/transforms.py
index 99490b5c9..0d22020af 100644
--- a/sphinx/transforms.py
+++ b/sphinx/transforms.py
@@ -27,10 +27,7 @@ from sphinx.util.nodes import (
from sphinx.util.osutil import ustrftime
from sphinx.util.i18n import find_catalog
from sphinx.util.pycompat import indent
-from sphinx.domains.std import (
- make_term_from_paragraph_node,
- make_termnodes_from_paragraph_node,
-)
+from sphinx.domains.std import register_term_to_glossary
default_substitutions = set([
@@ -340,18 +337,10 @@ class Locale(Transform):
# glossary terms update refid
if isinstance(node, nodes.term):
gloss_entries = env.temp_data.setdefault('gloss_entries', set())
- ids = []
- termnodes = []
for _id in node['names']:
if _id in gloss_entries:
gloss_entries.remove(_id)
- _id, _, new_termnodes = \
- make_termnodes_from_paragraph_node(env, patch, _id)
- ids.append(_id)
- termnodes.extend(new_termnodes)
-
- if termnodes and ids:
- patch = make_term_from_paragraph_node(termnodes, ids)
+ register_term_to_glossary(env, patch, _id)
node['ids'] = patch['ids']
node['names'] = patch['names']
processed = True