💾 Archived View for bbs.geminispace.org › s › Lagrange › 2932 captured on 2023-12-28 at 16:45:31. Gemini links have been rewritten to link to archived content

View Raw

More Information

⬅️ Previous capture (2023-11-14)

➡️ Next capture (2024-02-05)

🚧 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

Jul 09 · 6 months ago

3 Comments ↓

🚀 skyjake · Jul 09 at 20:15:

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 · Jul 09 at 20:21:

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 · Jul 09 at 22:09:

Ok, with a fixed font is looks much better