From 60f3e1295f0648943aa45d2cf8f2367097b32c07 Mon Sep 17 00:00:00 2001
From: Kirill Zhuravlev
Date: Tue, 14 Feb 2023 21:26:32 +0100
Subject: [PATCH] rename
---
pkg/markdown/convert.go | 4 ++--
pkg/markdown/convert_test.go | 8 ++++----
scripts.go | 4 ++--
3 files changed, 8 insertions(+), 8 deletions(-)
diff --git a/pkg/markdown/convert.go b/pkg/markdown/convert.go
index 0a14f00da9c..31a77e5e508 100644
--- a/pkg/markdown/convert.go
+++ b/pkg/markdown/convert.go
@@ -12,8 +12,8 @@ import (
"github.com/yuin/goldmark/util"
)
-// ConvertMarkdownToHTML converts markdown byte slice to a HTML byte slice
-func ConvertMarkdownToHTML(markdown []byte) ([]byte, error) {
+// ToHTML converts markdown byte slice to a HTML byte slice
+func ToHTML(markdown []byte) ([]byte, error) {
md := goldmark.New(
goldmark.WithExtensions(extension.GFM),
goldmark.WithParserOptions(
diff --git a/pkg/markdown/convert_test.go b/pkg/markdown/convert_test.go
index 0efdf84e588..9f2c58c25bc 100644
--- a/pkg/markdown/convert_test.go
+++ b/pkg/markdown/convert_test.go
@@ -5,7 +5,7 @@ import (
"testing"
)
-func TestConvertMarkdownToHTML(t *testing.T) {
+func TestToHTML(t *testing.T) {
input := []byte(
`## some headline
followed by some paragraph with [a link](https://example.local)
@@ -46,12 +46,12 @@ and some list:
embedded HTML is allowed
`,
)
- got, err := ConvertMarkdownToHTML(input)
+ got, err := ToHTML(input)
if err != nil {
- t.Errorf("ConvertMarkdownToHTML() error = %v", err)
+ t.Errorf("ToHTML() error = %v", err)
return
}
if strings.TrimSpace(string(got)) != strings.TrimSpace(string(expected)) {
- t.Errorf("ConvertMarkdownToHTML() got = %v, want %v", string(got), string(expected))
+ t.Errorf("ToHTML() got = %v, want %v", string(got), string(expected))
}
}
diff --git a/scripts.go b/scripts.go
index b810dc7b81f..9d185b58371 100644
--- a/scripts.go
+++ b/scripts.go
@@ -15,7 +15,7 @@ func readme() []byte {
if err != nil {
panic(err)
}
- html, err := markdown.ConvertMarkdownToHTML(input)
+ html, err := markdown.ToHTML(input)
if err != nil {
panic(err)
}
@@ -42,7 +42,7 @@ func GenerateHTML(srcFilename, outFilename string) error {
return err
}
- body, err := markdown.ConvertMarkdownToHTML(input)
+ body, err := markdown.ToHTML(input)
if err != nil {
return err
}