Update server.py
This commit is contained in:
parent
3907c686d4
commit
1bdc1d523f
1 changed files with 4 additions and 4 deletions
|
@ -66,18 +66,18 @@ def relay():
|
||||||
if i.split(" ")[1] != "text/gemini":
|
if i.split(" ")[1] != "text/gemini":
|
||||||
return f'<!DOCTYPE html>\n<html><head><meta charset="UTF-8"><link rel="stylesheet" href="https://swee.codes/style.css"><title>Something went wrong...</title></head><body><h1>Something went wrong...</h1><p>This path returned a file that isn\'t Gemtext, which Gem2Browser doesn\'t support downloading files.</p></body></html>'
|
return f'<!DOCTYPE html>\n<html><head><meta charset="UTF-8"><link rel="stylesheet" href="https://swee.codes/style.css"><title>Something went wrong...</title></head><body><h1>Something went wrong...</h1><p>This path returned a file that isn\'t Gemtext, which Gem2Browser doesn\'t support downloading files.</p></body></html>'
|
||||||
else:
|
else:
|
||||||
if i[0:1] == "# ":
|
if i[0:2] == "# ":
|
||||||
if title == "Something went wrong...":
|
if title == "Something went wrong...":
|
||||||
title = i[2:]
|
title = i[2:]
|
||||||
temp = i[2:]
|
temp = i[2:]
|
||||||
code += f"<h1>{temp}</h1>\n"
|
code += f"<h1>{temp}</h1>\n"
|
||||||
elif i[0:2] == "## ":
|
elif i[0:3] == "## ":
|
||||||
temp = i[3:]
|
temp = i[3:]
|
||||||
code += f"<h2>{temp}</h2>\n"
|
code += f"<h2>{temp}</h2>\n"
|
||||||
elif i[0:3] == "### ":
|
elif i[0:4] == "### ":
|
||||||
temp = i[4:]
|
temp = i[4:]
|
||||||
code += f"<h3>{temp}</h3>\n"
|
code += f"<h3>{temp}</h3>\n"
|
||||||
elif i[0:1] == "* ":
|
elif i[0:2] == "* ":
|
||||||
temp = i[2:]
|
temp = i[2:]
|
||||||
code += f"<ul><li>{temp}</li></ul>"
|
code += f"<ul><li>{temp}</li></ul>"
|
||||||
else:
|
else:
|
||||||
|
|
Loading…
Add table
Reference in a new issue