aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--route/util.go7
-rw-r--r--views/archive.html4
-rw-r--r--views/report.html5
3 files changed, 11 insertions, 5 deletions
diff --git a/route/util.go b/route/util.go
index 1b0eee7..09c5429 100644
--- a/route/util.go
+++ b/route/util.go
@@ -349,7 +349,7 @@ func TemplateFunctions(engine *html.Engine) {
return template.HTML(link)
})
- engine.AddFunc("shortExcerpt", func(post activitypub.ObjectBase) string {
+ engine.AddFunc("shortExcerpt", func(post activitypub.ObjectBase) template.HTML {
var returnString string
if post.Name != "" {
@@ -366,6 +366,9 @@ func TemplateFunctions(engine *html.Engine) {
returnString = match[0] + "..."
}
+ returnString = strings.ReplaceAll(returnString, "<", "&lt;")
+ returnString = strings.ReplaceAll(returnString, ">", "&gt;")
+
re = regexp.MustCompile(`(^.+\|)`)
match = re.FindStringSubmatch(returnString)
@@ -375,7 +378,7 @@ func TemplateFunctions(engine *html.Engine) {
returnString = strings.Replace(returnString, "|", ":", 1)
}
- return returnString
+ return template.HTML(returnString)
})
engine.AddFunc("parseLinkTitle", func(board string, op string, content string) string {
diff --git a/views/archive.html b/views/archive.html
index a5184a4..4df3a57 100644
--- a/views/archive.html
+++ b/views/archive.html
@@ -27,7 +27,7 @@
<td>[<a href="/poparchive?id={{ $e.Id }}&board={{ $board.Name }}">Pop</a>]</td>
{{ end }}
<td>{{ shortURL $board.Actor.Outbox $e.Id }}</td>
- <td style="overflow: hidden; word-wrap: break-word; text-overflow: ellipsis;">{{ shortExcerpt $e }}</td>
+ <td style="overflow: hidden; word-wrap: break-word; text-overflow: ellipsis; padding-left: 5px;">{{ shortExcerpt $e }}</td>
<td style="text-align: center;">[<a href="/{{ $board.Actor.Name }}/{{ shortURL $board.Actor.Outbox $e.Id }}">View</a>]</td>
</tr>
{{ else }}
@@ -36,7 +36,7 @@
<td>[<a href="/poparchive?id={{ $e.Id }}">Pop</a>]</td>
{{ end }}
<td>{{ shortURL $board.Actor.Outbox $e.Id }}</td>
- <td style="overflow: hidden; word-wrap: break-word; text-overflow: ellipsis;">{{ shortExcerpt $e }}</td>
+ <td style="overflow: hidden; word-wrap: break-word; text-overflow: ellipsis; padding-left: 5px;">{{ shortExcerpt $e }}</td>
<td style="text-align: center;">[<a href="/{{ $board.Actor.Name }}/{{ shortURL $board.Actor.Outbox $e.Id }}">View</a>]</td>
</tr>
{{ end }}
diff --git a/views/report.html b/views/report.html
index d691349..17f29cf 100644
--- a/views/report.html
+++ b/views/report.html
@@ -1,4 +1,7 @@
-{{ template "partials/top" .page }}
+<div style="max-width: 800px; margin: 0 auto;">
+ <h1 style="text-align: center;">/{{ .page.Board.Name }}/ - {{ .page.Board.PrefName }}</h1>
+ <p style="text-align: center;">{{ .page.Board.Summary }}</p>
+</div>
<div style="height: 500px; width: 420px; margin: 0 auto; margin-top:75px;">
<a href="{{ .page.Board.Actor.Id }}/{{ shortURL .page.Board.Actor.Outbox .page.Board.InReplyTo }}">[Back]</a>