Starchik1 commited on
Commit
159cee8
·
verified ·
1 Parent(s): 8ded969

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +9 -0
main.py CHANGED
@@ -159,6 +159,15 @@ def proxy(path):
159
  td { padding: 8px; }
160
  }
161
  '''
 
 
 
 
 
 
 
 
 
162
  soup.head.append(style_tag)
163
 
164
  # Convert navigation links to breadcrumb
 
159
  td { padding: 8px; }
160
  }
161
  '''
162
+ # Check if head exists, if not create it
163
+ if not soup.head:
164
+ head_tag = soup.new_tag('head')
165
+ if soup.html:
166
+ soup.html.insert(0, head_tag)
167
+ else:
168
+ html_tag = soup.new_tag('html')
169
+ html_tag.append(head_tag)
170
+ soup.append(html_tag)
171
  soup.head.append(style_tag)
172
 
173
  # Convert navigation links to breadcrumb