RC2
[static.git] / parse.py
index 4101379..e1296c6 100755 (executable)
--- a/parse.py
+++ b/parse.py
@@ -97,14 +97,14 @@ order: %d
 ''' % (tytul, podrozdzial_n)).encode('utf-8'))
     elif podrozdzial:
         if tag.tag == 'h4':
-            tag.text = re.sub('^[0-9\. ]+', '', tag.text)
+            tag.text = re.sub('^[0-9\. ]+', '', tag.text).strip()
             tag.tag = 'h2'
             slug = slughifi(tag.text)
             etree.SubElement(tag, "a", {'class': 'permalink',
                 'id': slug, 'href': '#' + slug,
                 'title': 'Link do tego miejsca'})
         elif tag.tag == 'h5':
-            tag.text = re.sub('^[0-9\. ]+', '', tag.text)
+            tag.text = re.sub('^[0-9\. ]+', '', tag.text).strip()
             tag.tag = 'h3'
         podrozdzial.write(etree.tostring(tag, encoding='utf-8'))