Detect markdown line width, resolve relative URLs #332

Merged
zeripath merged 10 commits from noerw/tea:markdown-linewrap into master 2021-03-12 12:28:47 +00:00
Showing only changes of commit aa6d49ab09 - Show all commits

View File

@ -14,14 +14,18 @@ import (
// Comments renders a list of comments to stdout
func Comments(comments []*gitea.Comment) {
var out = make([]string, len(comments))
var baseURL string
for i, c := range comments {
out[i] = formatComment(c)
baseURL = comments[i].HTMLURL
}
outputMarkdown(fmt.Sprintf(
6543 marked this conversation as resolved Outdated
Outdated
Review

if len comments == 0 ... nil pointer exeption!

if len comments == 0 ... nil pointer exeption!
// this will become a heading by means of the first --- from a comment
"Comments\n%s",
strings.Join(out, "\n"),
), comments[0].HTMLURL)
), baseURL)
}
// Comment renders a comment to stdout