shithub: hell

Download patch

ref: edf1b991bd73bc013c711951ffe23a0d3bd85e3a
parent: ab45dd40f8e15d02e8746dade0103951d8e35a6f
author: penny <penny@limitedideas.org>
date: Thu Oct 9 11:18:51 EDT 2025

fix an errant replcae and fix preformats

--- a/go.mod
+++ b/go.mod
@@ -18,5 +18,3 @@
 	golang.org/x/sys v0.34.0 // indirect
 	golang.org/x/text v0.27.0 // indirect
 )
-
-replace github.com/ergochat/readline => ./readline-fix
\ No newline at end of file
--- a/renderer.go
+++ b/renderer.go
@@ -30,10 +30,10 @@
 // Returns the rendered content of a status
 func (st *StatusFormatter) statusContent(status *mastodon.Status) string {
 	renderedPost, plaintexts := st.postContext.renderStatus(status.Content, st.postContext.ref)
+	renderedPost = html2text.HTML2Text(renderedPost)
 	for key, plaintext := range plaintexts {
 		renderedPost = strings.Replace(renderedPost, key, plaintext, 1)
 	}
-	renderedPost = html2text.HTML2Text(renderedPost)
 	return renderedPost
 }
 
--- a/renderer_test.go
+++ b/renderer_test.go
@@ -27,7 +27,7 @@
 		{"<p>hello<br>&nbsp;&nbsp;&nbsp;world</p>", "hello\r\n\u00a0\u00a0\u00a0world"},
 		// <pre> tests
 		{"<pre>hello world</pre>", "hello world"},
-		{"<pre>hello\nworld</pre>", "hello world"},                                          // TODO: Verify that this is correct
+		{"<pre>hello\nworld</pre>", "hello\nworld"},                                          // TODO: Verify that this is correct
 		{"<pre>hello <a href=\"https://example.com\">world</a></pre>", "hello (world) [1]"}, // TODO: Verify that this is correct
 		{"<pre>hello &amp; world</pre>", "hello & world"},
 		// Mentions
--