x/tools/present: fix element number check

Fixes golang/go#20605

Change-Id: Ia87097741b743d9b138f0f16540d601b9525c7de
Reviewed-on: https://go-review.googlesource.com/45110
Reviewed-by: Andrew Gerrand <adg@golang.org>
This commit is contained in:
kortschak 2017-06-08 09:28:27 +09:30 committed by Andrew Gerrand
parent a768197954
commit 987877771e

View File

@ -24,7 +24,7 @@ func (l Link) TemplateName() string { return "link" }
func parseLink(ctx *Context, fileName string, lineno int, text string) (Elem, error) {
args := strings.Fields(text)
if len(args) < 3 {
if len(args) < 2 {
return nil, fmt.Errorf("link element must have at least 2 arguments")
}
url, err := url.Parse(args[1])