Monorepo for Tangled tangled.org

appview: parse reference links from markdown body #760

merged opened by boltless.me targeting master from feat/mentions

Defined refResolver which will parse useful data from markdown body like @-mentions or issue/pr/comment mentions

Signed-off-by: Seongmin Lee git@boltless.me

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:plc:xasnlahkri4ewmbuzly2rlc5/sh.tangled.repo.pull/3m4vklvknsc22
+14 -14
Interdiff #10 #11
appview/db/reference.go

This file has not been changed.

+14 -14
appview/issues/issues.go
··· 880 880 RepoInfo: f.RepoInfo(user), 881 881 }) 882 882 case http.MethodPost: 883 - body := r.FormValue("body") 884 - mentions, _ := rp.refResolver.Resolve(r.Context(), body) 885 - 886 883 issue := &models.Issue{ 887 884 RepoAt: f.RepoAt(), 888 885 Rkey: tid.TID(), 889 886 Title: r.FormValue("title"), 890 - Body: body, 887 + Body: r.FormValue("body"), 891 888 Open: true, 892 889 Did: user.Did, 893 890 Created: time.Now(), ··· 901 898 RepoInfo: f.RepoInfo(user), 902 899 }) 903 900 case http.MethodPost: 901 + body := r.FormValue("body") 902 + mentions, _ := rp.refResolver.Resolve(r.Context(), body) 903 + 904 904 issue := &models.Issue{ 905 905 RepoAt: f.RepoAt(), 906 906 Rkey: tid.TID(), 907 907 Title: r.FormValue("title"), 908 - Body: r.FormValue("body"), 908 + Body: body, 909 909 Open: true, 910 910 Did: user.Did, 911 911 Created: time.Now(), ··· 959 959 // everything is successful, do not rollback the atproto record 960 960 atUri = "" 961 961 962 - rp.notifier.NewIssue(r.Context(), issue, mentions) 963 - rp.pages.HxLocation(w, fmt.Sprintf("/%s/issues/%d", f.OwnerSlashRepo(), issue.IssueId)) 964 - return 965 - 966 - 967 - 968 - // everything is successful, do not rollback the atproto record 969 - atUri = "" 970 - 971 962 rawMentions := markup.FindUserMentions(issue.Body) 972 963 idents := rp.idResolver.ResolveIdents(r.Context(), rawMentions) 973 964 l.Debug("parsed mentions", "raw", rawMentions, "idents", idents) ··· 977 968 mentions = append(mentions, ident.DID) 978 969 } 979 970 } 971 + rp.notifier.NewIssue(r.Context(), issue, mentions) 972 + rp.pages.HxLocation(w, fmt.Sprintf("/%s/issues/%d", f.OwnerSlashRepo(), issue.IssueId)) 973 + return 974 + 975 + 976 + 977 + // everything is successful, do not rollback the atproto record 978 + atUri = "" 979 + 980 980 rp.notifier.NewIssue(r.Context(), issue, mentions) 981 981 rp.pages.HxLocation(w, fmt.Sprintf("/%s/issues/%d", f.OwnerSlashRepo(), issue.IssueId)) 982 982 return
appview/models/reference.go

This file has not been changed.

appview/pages/markup/markdown.go

This patch was likely rebased, as context lines do not match.

appview/pages/markup/reference_link.go

This file has not been changed.

appview/pulls/pulls.go

This patch was likely rebased, as context lines do not match.

appview/refresolver/resolver.go

This file has not been changed.

appview/state/router.go

This patch was likely rebased, as context lines do not match.

appview/state/state.go

This file has not been changed.

History

13 rounds 0 comments
sign up or login to add to the discussion
1 commit
expand
appview: parse reference links from markdown body
2/3 failed, 1/3 running
expand
expand 0 comments
pull request successfully merged
1 commit
expand
appview: parse reference links from markdown body
2/3 failed, 1/3 running
expand
expand 0 comments
1 commit
expand
appview: parse reference links from markdown body
3/3 success
expand
expand 0 comments
1 commit
expand
appview: parse reference links from markdown body
3/3 success
expand
expand 0 comments
1 commit
expand
appview: parse reference links from markdown body
3/3 success
expand
expand 0 comments
1 commit
expand
appview: parse reference links from markdown body
3/3 success
expand
expand 0 comments
1 commit
expand
appview: parse reference links from markdown body
3/3 success
expand
expand 0 comments
1 commit
expand
appview: parse reference links from markdown body
3/3 success
expand
expand 0 comments
1 commit
expand
appview: parse reference links from markdown body
3/3 success
expand
expand 0 comments
1 commit
expand
appview: parse reference links from markdown body
1/3 failed, 2/3 running
expand
expand 0 comments
1 commit
expand
appview: parse reference links from markdown body
1/3 failed, 2/3 timeout
expand
expand 0 comments
1 commit
expand
appview: parse reference links from markdown body
3/3 success
expand
expand 0 comments
1 commit
expand
appview: parse reference links from markdown body
3/3 success
expand
expand 0 comments