Text reflow woes (or: I want bullets back!)y

Sean Conner sean at conman.org
Sat Jan 18 22:35:08 GMT 2020


It was thus said that the Great Julien Blanchard once stated:
> On 1/18/20 4:39 PM, solderpunk wrote:
> 
> >Julien, as the author of multiple Gemini clients, how do you feel about
> >the prospect of most text/gemini content having very long lines which
> >need to be wrapped to fit the viewport?
> 
> The ``` case will be a little bit more problematic as the parsing
> process would need to know what was parsed a few lines before
> (was a "tag" opened?).

  I found that to be easy to support.  The code looks like:

local literal = false

for line in file:lines() do
  if line:match "^#" then
    ...

  elseif line:match "^```$" then
    literal = not literal -- Yup, that's all there was to it.

  elseif line:match "^=>" then
    ...

  else
    if literal then
      display_text_to_width(line)
    else
      wrap_text_to_width(line)
    end
  end

  -spc


More information about the Gemini mailing list