about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2023-10-18 13:01:58 +0200
committerbptato <nincsnevem662@gmail.com>2023-10-18 13:01:58 +0200
commit46837a6b7186afd9fc2a45b6152672e553ac2c9e (patch)
tree90b43276f7f687c7931d924694180d5c5e83d852
parent1b15372501435f006be218105726a0c49dd23771 (diff)
downloadchawan-46837a6b7186afd9fc2a45b6152672e553ac2c9e.tar.gz
dirlist: quote path names in href
so that it does not choke on files with an apos in them.

(We could also htmlEscape it, but this should be enough since we
percent-encode the paths already.)
-rw-r--r--src/loader/dirlist.nim2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/loader/dirlist.nim b/src/loader/dirlist.nim
index 5de79084..2328cd55 100644
--- a/src/loader/dirlist.nim
+++ b/src/loader/dirlist.nim
@@ -42,7 +42,7 @@ func makeDirlist*(items: seq[DirlistItem]): string =
         path &= '/'
     elif item.t == ITEM_DIR:
       path &= '/'
-    var line = "<A HREF=" & path & '>' & htmlEscape(name) & "</A>"
+    var line = "<A HREF=\"" & path & "\">" & htmlEscape(name) & "</A>"
     while width <= maxw:
       if width mod 2 == 0:
         line &= ' '