Aug 23, 2022
I just added hyperlinks to my text editor in 35 lines of Lua

Here's the code.

Deep in the guts of the renderer, right before it renders a fragment of text, check if it's a file, and turn it into my button abstraction if so.

Caveats: links can't wrap over multiple lines, links can't contain spaces.

Incredibly inefficient, to check the file system for every single word. So it's in a fork for now while I decide just what to do with this new super power.


It's interesting to compare this approach with Gemini.

Gemini: links on their own line, support arbitrary link text.

Me: inline links are ok, but the text will always be the URL.

This post is part of my Freewheeling Apps Devlog.

Comments gratefully appreciated. Please send them to me by any method of your choice and I'll include them here.

archive
projects
writings
videos
subscribe
Mastodon
RSS (?)
twtxt (?)
Station (?)