2019-01-25 15:14:45 +00:00
|
|
|
package markdown
|
|
|
|
|
|
|
|
func Transform(input string) (string, error) {
|
|
|
|
|
|
|
|
// 1. bold
|
|
|
|
bold, err := boldTransform(input)
|
|
|
|
if err != nil {
|
|
|
|
return "", err
|
|
|
|
}
|
|
|
|
|
|
|
|
// 2. italic
|
|
|
|
italic, err := italicTransform(bold)
|
|
|
|
if err != nil {
|
|
|
|
return "", err
|
|
|
|
}
|
|
|
|
|
2019-01-27 15:39:34 +00:00
|
|
|
// 3. underline
|
2019-01-25 15:14:45 +00:00
|
|
|
underline, err := underlineTransform(italic)
|
|
|
|
if err != nil {
|
|
|
|
return "", err
|
|
|
|
}
|
|
|
|
|
2019-01-27 15:39:34 +00:00
|
|
|
// 4. hyperlink
|
|
|
|
hyperlinked, err := hyperlinkTransform(underline)
|
|
|
|
if err != nil {
|
|
|
|
return "", err
|
|
|
|
}
|
|
|
|
|
|
|
|
return hyperlinked, nil
|
2019-01-25 15:14:45 +00:00
|
|
|
}
|