func isURLAttr(tag, attr string) bool {
	if a, ok := linkURLattr[tag]; ok {
		return attr == a.attr
	}
	return false
}
return true if attr contains the URL of the tag.
package ht
import (
	"encoding/base64"
	"fmt"
	"io"
	"mime"
	"net/url"
	"strings"
	"github.com/vdobler/ht/errorlist"
	"golang.org/x/net/html"
	"golang.org/x/text/language"
)
func init() {
	RegisterCheck(ValidHTML{})
}
type ValidHTML struct {
	Ignore string `json:",omitempty"`
}
func (v ValidHTML) Execute(t *Test) error {
	if t.Response.BodyErr != nil {
		return ErrBadBody
	}
	mask, _ := ignoreMask(v.Ignore)
	state := newHTMLState(t.Response.BodyStr, mask)
	z := html.NewTokenizer(state)
	depth := 0
done:
	for {
		tt := z.Next()
		switch tt {
		case html.ErrorToken:
			if z.Err() == io.EOF {
				break done
			}
			return z.Err()
		case html.TextToken:
			if depth > 0 {
				state.checkEscaping(string(z.Raw()))
			}
		case html.StartTagToken, html.SelfClosingTagToken:
			raw := string(z.Raw())
			if len(raw) > 3 {
				state.checkAmbiguousAmpersand(raw[1 : len(raw)-1])
			}
			tn, hasAttr := z.TagName()
			if tt != html.SelfClosingTagToken && !emptyHTMLElement[string(tn)] {
				state.push(string(tn))
				depth++
			}
			tag := string(tn)
			state.count(tag)
			attrs := map[string]string{}
			var bkey, bval []byte
			for hasAttr {
				bkey, bval, hasAttr = z.TagAttr()
				key, val := string(bkey), string(bval)
				if _, ok := attrs[key]; ok {
					if state.ignore&issueAttr == 0 {
						state.err(fmt.Errorf("Duplicate attribute '%s'", key))
					}
				}
				attrs[key] = val
				switch {
				case key == "id":
					state.checkID(val)
				case tag == "label" && key == "for":
					state.recordLabel(val)
				case key == "lang":
					state.checkLang(val)
				case isURLAttr(tag, key):
					state.checkURL(val)
				}
			}
		case html.EndTagToken:
			tn, _ := z.TagName()
			state.pop(string(tn))
			depth--
		case html.CommentToken:
		case html.DoctypeToken:
			state.count("DOCTYPE")
		}
	}
	state.line = -1  
	if state.ignore&issueDoctype == 0 {
		if d := state.elementCount["DOCTYPE"]; d != 1 {
			if d > 1 {
				state.err(fmt.Errorf("Found %d DOCTYPE declarations", d))
			} else {
				state.err(fmt.Errorf("Missing DOCTYPE declaration"))
			}
		}
	}
	if state.ignore&issueLabelRef == 0 {
		for _, id := range state.labelFor {
			if _, ok := state.seenIDs[id]; !ok {
				state.err(fmt.Errorf("Label references unknown id '%s'", id))
			}
		}
	}
	if len(state.errors) == 0 {
		return nil
	}
	return state.errors
}