Skip to content

Commit 2a9d4f4

Browse files
authored
fix: Confusing function name (#152)
1 parent ee10a7f commit 2a9d4f4

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

internal/cmd/issue/edit/edit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ func edit(cmd *cobra.Command, args []string) {
157157

158158
body := params.body
159159
if isADF {
160-
body = md.JiraToGithubFlavored(body)
160+
body = md.ToJiraMD(body)
161161
}
162162

163163
er := jira.EditRequest{

pkg/jira/create.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ func (c *Client) getRequestData(req *CreateRequest) *createRequest {
155155

156156
switch v := req.Body.(type) {
157157
case string:
158-
cf.Description = md.JiraToGithubFlavored(v)
158+
cf.Description = md.ToJiraMD(v)
159159
case *adf.ADF:
160160
cf.Description = v
161161
}

pkg/jira/issue.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ type issueCommentRequest struct {
218218
// AddIssueComment adds comment to an issue using POST /issue/{key}/comment endpoint.
219219
// It only supports plain text comments at the moment.
220220
func (c *Client) AddIssueComment(key, comment string) error {
221-
body, err := json.Marshal(&issueCommentRequest{Body: md.JiraToGithubFlavored(comment)})
221+
body, err := json.Marshal(&issueCommentRequest{Body: md.ToJiraMD(comment)})
222222
if err != nil {
223223
return err
224224
}

pkg/md/md.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ import (
55
bf "github.com/russross/blackfriday/v2"
66
)
77

8-
// JiraToGithubFlavored translates Jira flavored markdown to Github flavored markdown.
9-
func JiraToGithubFlavored(jfm string) string {
8+
// ToJiraMD translates CommonMark to Jira flavored markdown.
9+
func ToJiraMD(jfm string) string {
1010
if jfm == "" {
1111
return jfm
1212
}

pkg/md/md_test.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import (
66
"github.com/stretchr/testify/assert"
77
)
88

9-
func TestJiraToGithubFlavored(t *testing.T) {
9+
func TestToJiraMD(t *testing.T) {
1010
jfm := `# H1
1111
Some _Markdown_ text.
1212
@@ -105,5 +105,5 @@ func main\(\) {
105105
fmt.Println\("hello world"\)
106106
}` + "```\n\n"
107107

108-
assert.Equal(t, expected, JiraToGithubFlavored(jfm))
108+
assert.Equal(t, expected, ToJiraMD(jfm))
109109
}

0 commit comments

Comments
 (0)