diff options
author | Dimitri Sokolyuk <demon@dim13.org> | 2018-08-20 16:03:49 +0200 |
---|---|---|
committer | Dimitri Sokolyuk <demon@dim13.org> | 2018-08-20 16:03:49 +0200 |
commit | a4b642477e28f412d48ee64e0f2e7b8d41c54d94 (patch) | |
tree | bd8310d457d4b6b21642fc55a799b81b65802af1 /href.go | |
parent | c99ea081a7fcd589b05125c5088b1557c1a25dfa (diff) |
trim space in title
Diffstat (limited to 'href.go')
-rw-r--r-- | href.go | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -41,7 +41,10 @@ func title(r io.Reader) (string, error) { if !utf8.Valid(t) { return "", errNotText } - return string(t), nil + if s := strings.TrimSpace(string(t)); len(s) > 0 { + return s, nil + } + return "", errNoTitle } } } |