Browse Source

Merge pull request #423 from Tastalian/master

Remove undesired <html> and <body> tags in extract_toc
Justin Mayer 10 years ago
parent
commit
4caaf1ba46
1 changed files with 2 additions and 0 deletions
  1. 2 0
      extract_toc/extract_toc.py

+ 2 - 0
extract_toc/extract_toc.py

@@ -41,6 +41,8 @@ def extract_toc(content):
         toc.extract()
         content._content = soup.decode()
         content.toc = toc.decode()
+        if content.toc.startswith('<html>'):
+            content.toc = content.toc[12:-14]
 
 
 def register():