Proposed minor spec changes, for comment.

solderpunk solderpunk at SDF.ORG
Thu May 21 21:47:31 BST 2020


On Tue, May 19, 2020 at 07:46:25AM +0000, solderpunk wrote:
 
> So now the question is which do we prefer, forcing servers to
> canonicalise (canonise?) everything, with client behaviour then being
> strictly limited, or letting servers just send whatever the author uses
> and forcing clients to accept any of CRLF, CR or LF?
> 
> In general I have preferred pushing burden to server authors over client
> authors for Gemini...but I expect the client burden is pretty small here
> as most languages will have some kind of functionality for breaking
> strings into lines which already handles this...

Some quick experimentation with Python revealed that str.splitlines()
is, indeed, smart enough to handle CRLF, CR and LF as linebreaks.
Encouraged by this, I made a single Gemini page that mixes all three
styles in a single document:

gemini://gemini.circumlunar.space/users/solderpunk/linebreaks.gmi

I visited it with a selection of clients, but the results weren't
encouraging.

It rendered just fine in AV-98, because apparently Python is awesome at
this.

Curiously, McCross, also in Python, could handle CR fine, split CRLF
into lines but displayed some stray characters at the end of lines, and
did not split LF lines at all.  Perhaps this is because it's a GUI
client and is relying on Tkinter to redner text?

Bombadillo and Castor (an old build of Castor I had lying around,
admittedly) both handled CR and CRLF fine, but did not split LF lines at
all.  The same was true of my tiny demo Lua and Go clients.

So, speccing any line ending as permissble, like HTML does, would
seemingly immediately render most clients out-of-spec.

Specifying CR or CRLF but not LF would require the minimum amount of
rework, but it would be hard to justify this by anything other than
laziness.  We either go strict, and require CRLF only, or we go
permissive, and allow anything, but we can't really pick and mix for the
sake of convenience.

We basically need to choose between forcing server authors to normalise
all endings to CRLF or forcing client authors to recgonise LF (even
though it'll probably never be seen in the wild).

Neither really thrill me, but, well, here we are.

Cheers,
Solderpunk


More information about the Gemini mailing list