瀏覽代碼

Update archivebox/index.py

Co-Authored-By: Nick Sweeting <[email protected]>
Julian Berman 6 年之前
父節點
當前提交
2e4b506c21
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      archivebox/index.py

+ 1 - 1
archivebox/index.py

@@ -187,7 +187,7 @@ def patch_links_index(link, out_dir=OUTPUT_DIR):
     # Patch HTML index
     html_path = os.path.join(out_dir, 'index.html')
     with open(html_path, 'r') as html_file:
-        html = [line[:-1] for line in html_file]
+        html = html_file.read().splitlines()
     for idx, line in enumerate(html):
         if title and ('<span data-title-for="{}"'.format(link['url']) in line):
             html[idx] = '<span>{}</span>'.format(title)