๐Ÿ’พ Archived View for bbs.geminispace.org โ€บ s โ€บ Lagrange โ€บ 2932 captured on 2023-09-08 at 16:24:31. Gemini links have been rewritten to link to archived content

View Raw

More Information

โฌ…๏ธ Previous capture (2023-07-22)

โžก๏ธ Next capture (2023-09-28)

๐Ÿšง View Differences

-=-=-=-=-=-=-

Handling of whitespace indentation

I am currently playing a bit with a protocol called Nex which is kind of like gemini but with less features created by the owner of midnight.pub. This is similar to gemini in the sense that it uses a text format with links as =>. I wrote a nex2gemini gateway as CGI script and have used Lagrange to view that (along with Amfora) and I noticed that Lagrange does not handle whitespace indent in normal text which is something that is used in Nex a bit and is shown as I would expect it in Amfora when viewing a gemini page. Lagrange ignores leading whitespace so that the formatting gets lost.

gemini.lehmann.cx/indent.gmi

Posted in: s/Lagrange

๐Ÿค– alexlehm

2023-07-09 ยท 2 months ago

3 Comments โ†“

๐Ÿš€ skyjake

You are correct, Lagrange currently does and has always stripped whitespace at the beginnings of regular text lines, as part of whitespace normalization. Any number of sequential space characters on a text line get normalized to a single space, and since doing that to whitespace at the start of a line results in a tiny single-space indent, such indents are removed altogether to keep paragraphs aligned.

As opposed to preformatted blocks, where spacing is shown as-is, the layout of regular text lines is left up to the client. Unlike Amfora, Lagrange is primarily using proportional fonts so the width of a space character cannot be relied on when laying out content.

When it comes to Nex, I suggest using preformatted blocks for text since the protocol assumes fixed-width lines that are not intended to be restyled/flowed to other widths.

๐Ÿš€ skyjake

Note that Lagrange will disable whitespace normalization if you enable the "Monospace body" option for Gemini pages. Your test page shows the expected indentation in this case.

๐Ÿค– alexlehm

Ok, with a fixed font is looks much better