-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsyntax_sugar.go
More file actions
43 lines (34 loc) · 1000 Bytes
/
syntax_sugar.go
File metadata and controls
43 lines (34 loc) · 1000 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
package markdown
import "fmt"
// Link return text with link format.
func Link(text, url string) string {
return fmt.Sprintf("[%s](%s)", text, url)
}
// Image return text with image format.
func Image(text, url string) string {
return fmt.Sprintf("", text, url)
}
// Strikethrough return text with strikethrough format.
func Strikethrough(text string) string {
return fmt.Sprintf("~~%s~~", text)
}
// Bold return text with bold format.
func Bold(text string) string {
return fmt.Sprintf("**%s**", text)
}
// Italic return text with italic format.
func Italic(text string) string {
return fmt.Sprintf("*%s*", text)
}
// BoldItalic return text with bold and italic format.
func BoldItalic(text string) string {
return fmt.Sprintf("***%s***", text)
}
// Code return text with code format.
func Code(text string) string {
return fmt.Sprintf("`%s`", text)
}
// Highlight return text with highlight format.
func Highlight(text string) string {
return fmt.Sprintf("==%s==", text)
}