Index: src/caterpillar.py |
diff --git a/src/caterpillar.py b/src/caterpillar.py |
index 4a0a8b5c38e4e035c8b1953a6cd4babbfe734961..c658708a54f6d69c159f8f93f07db947b8d68e92 100755 |
--- a/src/caterpillar.py |
+++ b/src/caterpillar.py |
@@ -286,6 +286,13 @@ def inject_misc_tags(soup, ca_manifest, root_path, html_path): |
This can be either absolute or relative. |
html_path: Path to the HTML document being modified. |
""" |
+ if not soup.head: |
Matt Giuca
2016/01/29 02:19:26
head = soup.head
if not head:
...
Now you are g
Matthew Alger
2016/01/29 02:41:51
Okay, done. I'm not sure I see the benefit in this
Matt Giuca
2016/01/29 03:04:13
Mostly performance.
You generally want to avoid d
|
+ head = soup.new_tag('head') |
+ if soup.html: |
+ soup.html.insert(0, head) |
+ else: |
+ soup.insert(0, head) |
+ |
# Add manifest link tag. |
manifest_path = os.path.join(root_path, PWA_MANIFEST_FILENAME) |
manifest_link = soup.new_tag('link', rel='manifest', href=manifest_path) |