Quellcode durchsuchen

remove undesired <html> and <body> tags from bsoup

Tastalian vor 10 Jahren
Ursprung
Commit
1e1f8999b9
1 geänderte Dateien mit 2 neuen und 0 gelöschten Zeilen
  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():