Help us shape the future of Go! Take the 2026 Go Developer Survey

youtube

package
v0.0.0-...-0f83b93 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 27, 2024 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Examples

Constants

This section is empty.

Variables

View Source
var LinkExp = regexp.MustCompile(`([^<]|^)(https://youtu\.be\/\S+)`)

Functions

func Linkify

func Linkify(args ...any) string
Example
package main

import (
	"fmt"

	"github.com/david-sterling/filter/youtube"
)

func main() {
	text := `
    This is a paragraph with https://youtu.be/inpara in it.

		* https://youtu.be/inlist

		https://youtu.be/ownblock

`

	fmt.Printf("%q\n", youtube.Linkify(text))

}
Output:
"\n    This is a paragraph with 📺 <https://youtu.be/inpara> in it.\n\n\t\t* 📺 <https://youtu.be/inlist>\n\n\t\t📺 <https://youtu.be/ownblock>\n\n"
Example (Ignore_angle)
package main

import (
	"fmt"

	"github.com/david-sterling/filter/youtube"
)

func main() {

	text := "This is a paragraph with <https://youtu.be/inpara> in it."
	fmt.Println(youtube.Linkify(text))

}
Output:
This is a paragraph with <https://youtu.be/inpara> in it.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL