summaryrefslogtreecommitdiff
path: root/scanner.go
diff options
context:
space:
mode:
authorHorus32015-06-15 15:00:21 +0200
committerHorus32015-06-15 15:00:21 +0200
commitdd4baa267dbdfe279aab5f4122305ac51c0c6a3d (patch)
tree3704ecc1d709e0613d972d778b7b9ee046f96e1c /scanner.go
parentffdfbb70cf2af25482b56f08e8cad53104d91e61 (diff)
downloaduhttpd-dd4baa267dbdfe279aab5f4122305ac51c0c6a3d.tar.gz
Fix css and some bugs.
Diffstat (limited to 'scanner.go')
-rw-r--r--scanner.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/scanner.go b/scanner.go
index 10be11b..53a6aeb 100644
--- a/scanner.go
+++ b/scanner.go
@@ -7,13 +7,14 @@ package main
*/
import "C"
import (
+ "html/template"
"log"
"strings"
)
type Link struct {
- Url string
- Text string
+ Url template.URL
+ Text template.HTML
IsDir bool
}
@@ -29,16 +30,16 @@ func getToken(input string) []Link {
if token == C.TOKEN_URL {
// flex reads the href attr
- l.Url = C.GoString(C.yylval)
+ l.Url = template.URL(C.GoString(C.yylval))
- if strings.HasSuffix(l.Url, "/") {
+ if strings.HasSuffix(C.GoString(C.yylval), "/") {
l.IsDir = true
}
} else if token == C.TOKEN_TEXT {
// flex reads the link description
- l.Text = C.GoString(C.yylval)
+ l.Text = template.HTML(C.GoString(C.yylval))
ls = append(ls, l)
l = Link{}
} else {