1. mbrochh
  2. sphinx

Commits

Robert Lehmann  committed e159611

Fix empty and duplicate nodes.

  • Participants
  • Parent commits fb7456b
  • Branches default

Comments (0)

Files changed (1)

File sphinx/builders/intl.py

View file
  • Ignore whitespace
         for node in doctree.traverse(nodes.TextElement):
             if isinstance(node, (nodes.Invisible, nodes.Inline)):
                 continue
-            msg = node.astext().replace('\n', ' ')
+            msg = node.astext().replace('\n', ' ').strip()
+            # XXX nodes rendering empty are likely a bug in sphinx.addnodes
+            # XXX msgctxt for duplicate messages?
+            if not msg or msg in catalog:
+                continue
             catalog.append(msg)
 
     def finish(self):