Skip to content

Commit 668494e

Browse files
authored
fix(comment-sync): escape self footnote marker (#16)
1 parent 56ed36d commit 668494e

2 files changed

Lines changed: 5 additions & 5 deletions

File tree

internal/core/comment_sync.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -576,9 +576,9 @@ func issueURL(owner, repo, targetType string, number int, fallback string) strin
576576

577577
func selfReferenceFootnote(targetType string) string {
578578
if targetType == "pull_request" {
579-
return "* This PR"
579+
return "`*` This PR"
580580
}
581-
return "* This issue"
581+
return "`*` This issue"
582582
}
583583

584584
func markdownCell(value string) string {

internal/core/comment_sync_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -157,13 +157,13 @@ func TestCommentSyncTriggerAndReconcileCreatesAndUpdatesComments(t *testing.T) {
157157
require.Contains(t, issueComments[0].Body, "Title: Auth reliability")
158158
require.Contains(t, issueComments[0].Body, "[#11*](https://github.com/acme/widgets/issues/11)")
159159
require.Contains(t, issueComments[0].Body, "[#22](https://github.com/acme/widgets/pull/22)")
160-
require.Contains(t, issueComments[0].Body, "* This issue")
160+
require.Contains(t, issueComments[0].Body, "`*` This issue")
161161

162162
prComments := store.list(22)
163163
require.Len(t, prComments, 1)
164164
require.Contains(t, prComments[0].Body, "[#22*](https://github.com/acme/widgets/pull/22)")
165165
require.Contains(t, prComments[0].Body, "[#11](https://github.com/acme/widgets/issues/11)")
166-
require.Contains(t, prComments[0].Body, "* This PR")
166+
require.Contains(t, prComments[0].Body, "`*` This PR")
167167

168168
require.NoError(t, db.WithContext(ctx).Model(&database.Group{}).Where("id = ?", group.ID).Updates(map[string]any{
169169
"title": "Auth reliability follow-up",
@@ -309,7 +309,7 @@ func TestCommentSyncDeletesDuplicateManagedComments(t *testing.T) {
309309
issueComments := store.list(11)
310310
require.Len(t, issueComments, 1)
311311
require.Contains(t, issueComments[0].Body, "Title: Auth reliability")
312-
require.Contains(t, issueComments[0].Body, "* This issue")
312+
require.Contains(t, issueComments[0].Body, "`*` This issue")
313313
}
314314

315315
func TestCommentSyncRetryableFailureSucceedsLater(t *testing.T) {

0 commit comments

Comments
 (0)