X-Git-Url: https://git.mdrn.pl/static.git/blobdiff_plain/e13dcef57d346104d7d085a8a5f893052c1f0bb0..290c8eac26043188d00ea58c57e1d42d67277aaf:/parse.py diff --git a/parse.py b/parse.py index 4101379..e1296c6 100755 --- 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'))