summaryrefslogtreecommitdiff
path: root/repo.go
diff options
context:
space:
mode:
authortjpcc <tjp@ctrl-c.club>2023-09-17 16:52:47 -0600
committertjpcc <tjp@ctrl-c.club>2023-09-17 16:52:47 -0600
commitfd79efff7504853ab4b7070ee186f4b7a346d21d (patch)
treec3890df1ed1d27395251f2f927e02c156a2f3db6 /repo.go
parenta7ce20fee62a52794bf8bf940d0fd1f4134158b1 (diff)
fix diffs and add diffstats in gopher
Diffstat (limited to 'repo.go')
-rw-r--r--repo.go7
1 files changed, 1 insertions, 6 deletions
diff --git a/repo.go b/repo.go
index 938bcc9..0805913 100644
--- a/repo.go
+++ b/repo.go
@@ -216,12 +216,7 @@ func (r Readme) GeminiEscapedContents() string {
}
func (r Readme) GopherEscapedContents(selector, host, port string) string {
- trailer := "\t"+selector+"\t"+host+"\t"+port+"\r\n"
- lines := strings.Split(r.RawContents, "\n")
- for i := range lines {
- lines[i] = "i"+strings.TrimRight(strings.ReplaceAll(lines[i], "\t", " "), "\r\n") + trailer
- }
- return strings.Join(lines, "")
+ return gopherRawtext(selector, host, port, r.RawContents)
}
func (r *Repository) Readme(ctx context.Context, ref string) (*Readme, error) {