Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Gopher: Inconsistent rendering of i (informational) lines across platforms and with UTF-8 Greek text #760

@greektv

Description

@greektv

Description
Lagrange renders Gopher i (informational) lines inconsistently across platforms (desktop vs Android) and applies unintended heading-style formatting to short i lines, particularly when the content uses UTF-8 Greek text.

The same gophermap content displays correctly on Lagrange desktop (Windows/Linux) but breaks visually on Lagrange for Android. Other Gopher clients (Gophie, Gopher Browser for Windows) display the same content correctly on all platforms.

Two related issues

Issue 1: Short i lines rendered as headings

When a Gopher gophermap contains i lines of varying lengths (as naturally produced by text wrapping), Lagrange applies heading-style formatting to lines that are significantly shorter than their neighbors. This is especially problematic with Greek UTF-8 text, where word-length distributions produce more short final lines in paragraphs than English.

For example, in a paragraph that wraps to 6 lines of 65-72 characters followed by a final line of 7-25 characters (a normal word-wrap remainder), Lagrange renders the short final line in a larger, heading-like font instead of treating it as continuation body text.
Issue 2: Platform inconsistency between desktop and Android

The same gophermap renders differently on desktop Lagrange vs Android Lagrange. On desktop, i lines padded with trailing spaces to a uniform width (e.g., 72 characters via .ljust(72)) are rendered as a consistent preformatted block. On Android, the same content appears to be re-flowed or re-wrapped, stripping the trailing spaces and reintroducing the heading-heuristic problem from Issue 1.

How to reproduce

Visit this Gopher URL in Lagrange on desktop and Android:
gopher://gopher.greektimes.ca:70/1/articles/el/20251021-1909

Image

This is a news article. The gophermap consists entirely of standard i lines with tab-separated fields (i{text}\tfake\t(NULL)\t0).

Desktop (Windows/Linux): Article body renders as a uniform block of preformatted text. No heading artifacts.
Android: Short lines within the body text are rendered with heading-style formatting. Paragraph breaks appear inconsistent. Lines that are part of the same paragraph are visually separated with different font sizes.

For comparison, the same article renders correctly in:

Gophie (attached screenshot):

Image

Gopher Browser for Windows (attached screenshot):

Image

Other English articles at the same server shows fewer issues because English word lengths produce more uniform line distributions after wrapping

Expected behavior

All i lines in a gophermap should render with the same text style regardless of their length. The Gopher protocol does not define heading semantics for i lines. Line length should not influence rendering style.

Rendering should be consistent across Lagrange platforms (desktop, Android, iOS) for identical gophermap content.

Observed behavior

Short i lines (under approximately 30 characters) are rendered with a larger, heading-like font

The threshold appears to be relative to neighboring lines rather than absolute

Trailing space padding that forces uniform line width on desktop is stripped or ignored on Android
Greek UTF-8 text triggers this more frequently than English due to longer average word lengths producing more short wrap-remainder lines

Gopher Browser for Windows showing it correctly)

Environment

Lagrange desktop: latest stable release, Windows and Linux
Lagrange Android: latest available APK/TestFlight build

Gopher server: Gophernicus on Debian 13

Content: UTF-8 encoded text, standard gophermap format

Suggested fix
Consider treating all i lines uniformly regardless of length, or providing a user-facing option to disable the heading-detection heuristic for i lines. The Gopher RFC (1436) does not assign semantic meaning to i line length.
At minimum, the Android build should render i lines consistently with the desktop build for the same gophermap content.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggopherpending releaseIssue has been resolved and the fix/feature will be included in an upcoming release.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions