From a6f66afbac2d724187565c0b8d4a907697ac9ab9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gr=C3=A9gory=20Soutad=C3=A9?= Date: Tue, 13 Nov 2012 18:58:50 +0100 Subject: [PATCH] Fix a little bug due to
 tag in 

---
 generators/index.py | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/generators/index.py b/generators/index.py
index 5c2302c..0e98356 100644
--- a/generators/index.py
+++ b/generators/index.py
@@ -235,14 +235,21 @@ class Index(DynastieGenerator):
 
         lexer.encoding = 'utf-8'
         formatter.encoding = 'utf-8'
-
+        
         writer = StrictUTF8Writer()
-        node.firstChild.firstChild.writexml(writer)
+        node.writexml(writer)
         code = writer.getvalue().encode('utf-8')
 
+        start = code.find('
');
+        end = code.rfind('
'); + + if start == -1 or end == -1 or end < start: + self.addError('Error parsing ') + return '' + r,w = os.pipe() r,w=os.fdopen(r,'r',0), os.fdopen(w,'w',0) - highlight(code, lexer, formatter, w) + highlight(code[start+5:end], lexer, formatter, w) w.close() code = r.read()