Change URI to IRI after finding validation pattern

This commit is contained in:
2024-10-16 17:33:25 +02:00
parent b76e529ca3
commit 082e71a698
10 changed files with 41 additions and 32 deletions

View File

@@ -9,7 +9,7 @@ type Link struct {
*CommonAttributes
Title Text `xml:"title,attr,omitempty"`
Content Content `xml:"content"` // undefinedContent in RFC4287
Href URI `xml:"href,attr"`
Href IRI `xml:"href,attr"`
Rel string `xml:"rel,attr,omitempty"`
Type MediaType `xml:"type,attr,omitempty"`
HrefLang LanguageTag `xml:"hreflang,attr,omitempty"`
@@ -22,7 +22,7 @@ func NewLink(href string) (*Link, error) {
return nil, fmt.Errorf("error creating content element: %v", err)
}
return &Link{Href: URI(href), Content: content}, nil
return &Link{Href: IRI(href), Content: content}, nil
}
func (l *Link) Check() error {