diff --git a/public/style.css b/public/style.css
index 7cb8d12..b9eb6f9 100644
--- a/public/style.css
+++ b/public/style.css
@@ -304,11 +304,11 @@ form.savecomment {
.morecomments a:hover {
text-decoration: underline;
}
-.member {
+.member, .block {
display: inline-block;
margin-bottom:3px;
}
-.member input {
+.member input, .block input {
font-size: 10px;
font-weight: bold;
display: inline-block;
@@ -320,10 +320,10 @@ form.savecomment {
bottom: 1px;
cursor: pointer;
}
-.join input {
+.join input, .block input {
background-color: green;
}
-.leave input {
+.leave input, .block.unblock input {
background-color: #cf6165;
}
.pending input {
diff --git a/routes.go b/routes.go
index f914ab8..17c8355 100644
--- a/routes.go
+++ b/routes.go
@@ -119,9 +119,9 @@ var funcMap = template.FuncMap{
if re.MatchString(p.URL.String()) {
return p.URL.String() + "?format=jpg&thumbnail=96"
}
- re = regexp.MustCompile(`^https:\/\/i.imgur.com\/([a-zA-Z0-9]+)\.([a-z]+)$`)
+ re = regexp.MustCompile(`^https:\/\/(i\.)?imgur.com\/([a-zA-Z0-9]{5,})(\.[a-zA-Z0-9]+)?`)
if re.MatchString(p.URL.String()) {
- return re.ReplaceAllString(p.URL.String(), "https://i.imgur.com/${1}s.$2")
+ return re.ReplaceAllString(p.URL.String(), "https://i.imgur.com/${2}s.jpg")
}
if p.URL.IsValid() {
return "/_/static/link.png"
@@ -139,14 +139,17 @@ var funcMap = template.FuncMap{
}
converted := buf.String()
converted = strings.Replace(converted, `!$1@$2 `)
if os.Getenv("LEMMY_DOMAIN") == "" {
+ re = regexp.MustCompile(`href="\/(c\/[a-zA-Z0-9\-]+|(post|comment)\/\d+)`)
+ converted = re.ReplaceAllString(converted, `href="https://`+host+`/$1`)
re := regexp.MustCompile(`href="https:\/\/([a-zA-Z0-9\.\-]+\/(c\/[a-zA-Z0-9]+|(post|comment)\/\d+))`)
converted = re.ReplaceAllString(converted, `href="/$1`)
+ } else {
+ re := regexp.MustCompile(`href="https:\/\/` + os.Getenv("LEMMY_DOMAIN") + `\/(c\/[a-zA-Z0-9]+|(post|comment)\/\d+)`)
+ converted = re.ReplaceAllString(converted, `href="/$1`)
}
- re = regexp.MustCompile(`href="\/(c\/[a-zA-Z0-9\-]+|(post|comment)\/\d+)`)
- converted = re.ReplaceAllString(converted, `href="/`+host+`/$1`)
- re = regexp.MustCompile(` !([a-zA-Z0-9]+)@([a-zA-Z0-9\.\-]+) `)
- converted = re.ReplaceAllString(converted, ` !$1@$2 `)
re = regexp.MustCompile(`::: spoiler (.*?)\n([\S\s]*?):::`)
converted = re.ReplaceAllString(converted, "$1
$2