Commit 876538cd authored by Alok Saldanha's avatar Alok Saldanha
Browse files

#5 fixed missing slash in path joining

parent 6656de62
...@@ -88,6 +88,7 @@ def render_entries(entries): ...@@ -88,6 +88,7 @@ def render_entries(entries):
def render_entry(entry): def render_entry(entry):
if entry["type"] == "file": if entry["type"] == "file":
return f"<li> <a href='view{entry['path']}'>{entry['name']}</a></li>" url = 'view' + '/' + entry['path'].lstrip("/")
return f"<li> <a href='{ url}'>{entry['name']}</a></li>"
elif entry["type"] == "directory": elif entry["type"] == "directory":
return f"<li>{entry['name']}{render_entries(entry['children'])}</li>" return f"<li>{entry['name']}{render_entries(entry['children'])}</li>"
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment