~lioploum/offpunk-devel

format to respect 'ascii-art' (and indentation in general) in gopher v1 PROPOSED

_jmcs_: 1
 format to respect 'ascii-art' (and indentation in general) in gopher

 1 files changed, 1 insertions(+), 1 deletions(-)
José Manuel Castroagudín Silva <chavescesures@gmail.com>
(re-sending this to the list without the image attachment, for completion)
Morning,
You can try for example
gopher://astio.zapto.org/1/~C7H14N2O3/
or
gopher://texto-plano.xyz
for a simpler example of a site (hole?) using an "ascii banner".

I'll attach an image to show current and after change (after on top :)
), hope the mailing list accepts it.
----
EDIT: it does not :D

O mér., 19 de feb. de 2025 ás 08:29, Ploum (<sourcehut24@ploum.eu>) escribiu:
José Manuel Castroagudín Silva <chavescesures@gmail.com>



          
          
          
        
      

      
      
      
      
      
      
    
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~lioploum/offpunk-devel/patches/57574/mbox | git am -3
Learn more about email & git

[PATCH] format to respect 'ascii-art' (and indentation in general) in gopher Export this patch

---

Hi there,
I've noticed that some gopher sites include some "ascii art" that was showing left-aligned in offpunk

Taking a look at the code, and playing around a bit, I ended doing this very tiny little change (based on what you do for preformatted text in gemini, I think), t    hat solves that issue. I think it makes sense, given my limited gopher use, since a lot of places use indentation and whitespaces to spice up their site.

What I'm not sure at all is if it will cause side effects for some other cases somewhere else. If so, feel free to ignore.

Regards!

PS: I think that, again, I have sent this email to the wrong address before. Apologies :(


 ansicat.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ansicat.py b/ansicat.py
index e530fdb..d792433 100755
--- a/ansicat.py
+++ b/ansicat.py
@@ -815,7 +815,7 @@ class GopherRenderer(AbstractRenderer):
            if line.startswith("i"):
                towrap = line[1:].split("\t")[0]
                if len(towrap.strip()) > 0:
                    r.add_text(towrap)
                    r.add_block(towrap+"\n")
                else:
                    r.newparagraph()
            elif line.strip() not in [".", ""]:
-- 
2.47.2
Hi,

Thanks for your patch!

Could you send me a gopher URL which demonstrates the bug so I could 
test it?


Le 25 fév 18 10:38, _jmcs_ a écrit :
Hi,

Thanks for the patch. It has been merged!


Le 25 fév 18 10:38, _jmcs_ a écrit :