shithub: hell

Download patch

ref: 01b6900da724f9e1ad95856099b2b5372f246687
parent: cfbaba2862bc94499cd71ee26123c6c72864ae4e
author: penny <penny@limitedideas.org>
date: Thu Aug 14 23:28:46 EDT 2025

More work on those extra newlines it was extra spaces too

--- a/format.go
+++ b/format.go
@@ -70,10 +70,13 @@
 	}
 	
 	result = append(result, remainder...)
-	//Sometimes posts come from mastodon with a newline at the end
+	//Sometimes posts come from mastodon with a newline/space at the end
 	//you can actually see it in the web interface
+	if(strings.HasSuffix(string(result), " ")) {
+		result = result[:len(result)-1]
+	}
 	if(strings.HasSuffix(string(result), "\n")) {
-		result = result[:1]
+		result = result[:len(result)-1]
 	}
 	//Put a newline at the end if status takes multiple lines
 	if longline {
--- a/mastodon.go
+++ b/mastodon.go
@@ -88,7 +88,7 @@
 			href := ""
 			for attr := range node.Attr {
 				if node.Attr[attr].Key == "class" && strings.Contains(node.Attr[attr].Val, "mention") {
-					node.Data = "span"
+					node.Data = "div"
 					ismention = true
 					continue
 				}
--