(htmlOld string)
| 293 | } |
| 294 | |
| 295 | func (c *CloudStore) ImageWithDomain(htmlOld string) (htmlNew string) { |
| 296 | doc, err := goquery.NewDocumentFromReader(strings.NewReader(htmlOld)) |
| 297 | if err != nil { |
| 298 | helper.Logger.Error(err.Error()) |
| 299 | return htmlOld |
| 300 | } |
| 301 | doc.Find("img").Each(func(i int, s *goquery.Selection) { |
| 302 | // For each item found, get the band and title |
| 303 | if src, exist := s.Attr("src"); exist { |
| 304 | if !(strings.HasPrefix(src, "http://") || strings.HasPrefix(src, "https://")) { |
| 305 | s.SetAttr("src", c.GetSignURL(src)) |
| 306 | } |
| 307 | } |
| 308 | |
| 309 | }) |
| 310 | htmlNew, _ = doc.Find("body").Html() |
| 311 | return |
| 312 | } |
| 313 | |
| 314 | func (c *CloudStore) ImageWithoutDomain(htmlOld string) (htmlNew string) { |
| 315 | doc, err := goquery.NewDocumentFromReader(strings.NewReader(htmlOld)) |
no test coverage detected