mirror of
https://github.com/nkanaev/yarr.git
synced 2025-11-08 02:19:37 +00:00
gofmt -s -w .
This commit is contained in:
@@ -9,8 +9,8 @@ import (
|
||||
|
||||
var (
|
||||
youtubeFrame = `<iframe src="https://www.youtube.com/embed/%s" width="560" height="315" frameborder="0" allowfullscreen></iframe>`
|
||||
vimeoFrame = `<iframe src="https://player.vimeo.com/video/%s" width="640" height="360" frameborder="0" allowfullscreen></iframe>`
|
||||
vimeoRegex = regexp.MustCompile(`\/(\d+)$`)
|
||||
vimeoFrame = `<iframe src="https://player.vimeo.com/video/%s" width="640" height="360" frameborder="0" allowfullscreen></iframe>`
|
||||
vimeoRegex = regexp.MustCompile(`\/(\d+)$`)
|
||||
)
|
||||
|
||||
func VideoIFrame(link string) string {
|
||||
@@ -31,7 +31,7 @@ func VideoIFrame(link string) string {
|
||||
|
||||
if l.Host == "vimeo.com" {
|
||||
if matches := vimeoRegex.FindStringSubmatch(l.Path); len(matches) > 0 {
|
||||
return fmt.Sprintf(vimeoFrame, matches[1])
|
||||
return fmt.Sprintf(vimeoFrame, matches[1])
|
||||
}
|
||||
}
|
||||
return ""
|
||||
|
||||
Reference in New Issue
Block a user