From 8624d07a4fcc015aad64e28b34479858d150bed3 Mon Sep 17 00:00:00 2001 From: grubert Date: Fri, 13 Jul 2018 07:58:46 +0000 Subject: [PATCH] Change Test.term prefer if over try git-svn-id: http://svn.code.sf.net/p/docutils/code/trunk@8226 929543f6-e4f2-0310-98a6-ba3bd3dd1d04 --- docutils/docutils/parsers/rst/states.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/docutils/docutils/parsers/rst/states.py b/docutils/docutils/parsers/rst/states.py index 2cab2d56f..1dbcb2aa8 100644 --- a/docutils/docutils/parsers/rst/states.py +++ b/docutils/docutils/parsers/rst/states.py @@ -2866,11 +2866,10 @@ class Text(RSTState): for part in parts[1:]: classifier_node = nodes.classifier(part, utils.unescape_rawsource(part)) - try: + # might be a reference or similar in the next node + # then classifier_node is empty + if len(classifier_node) > 0: classifier_node[0].rawsource = part - except IndexError: - # might be a reference or similar in the next node - pass node_list.append(classifier_node) else: node_list[-1] += node -- 2.11.4.GIT