Merge pull request #32 from dalf/encoding

[enh] support different encodings

git-svn-id: file:///srv/svn/repo/yukari/trunk@43 f3bd38d9-da89-464d-a02a-eb04e43141b5
This commit is contained in:
asciimoo 2016-11-26 16:49:35 +00:00
parent be236f879b
commit ce7aee2e64

View File

@ -359,12 +359,11 @@ func sanitizeHTML(rc *RequestConfig, out io.Writer, htmlDoc []byte) {
if bytes.Equal(tag, []byte("base")) {
for {
attrName, attrValue, moreAttr := decoder.TagAttr()
if !bytes.Equal(attrName, []byte("href")) {
continue
}
parsedURI, err := url.Parse(string(attrValue))
if err == nil {
rc.BaseURL = parsedURI
if bytes.Equal(attrName, []byte("href")) {
parsedURI, err := url.Parse(string(attrValue))
if err == nil {
rc.BaseURL = parsedURI
}
}
if !moreAttr {
break