Function
parseAttributes
(input string, pattern *regexp.Regexp)
Source from the content-addressed store, hash-verified
| 339 | } |
| 340 | |
| 341 | func parseAttributes(input string, pattern *regexp.Regexp) map[string]string { |
| 342 | attributes := make(map[string]string) |
| 343 | for _, match := range pattern.FindAllStringSubmatch(input, -1) { |
| 344 | if len(match) < 3 { |
| 345 | continue |
| 346 | } |
| 347 | attributes[strings.ToLower(match[1])] = html.UnescapeString(match[2]) |
| 348 | } |
| 349 | return attributes |
| 350 | } |
| 351 | |
| 352 | func normalizeImageURL(url string) string { |
| 353 | if url == "" { |
Tested by
no test coverage detected