Adds option to handle preformatted code blocks in different ways for gemini #148
No reviewers
Labels
No Label
blocked
bug
build
documentation
duplicate
enhancement
finger
gemini
gopher
help wanted
http
in progress
invalid
local
needs-info
non-code
non-functional
non-urgent
question
release
rendering
suggestion
telnet
terminal
urgent
wontfix
No Milestone
No Assignees
1 Participants
Notifications
Due Date
No due date set.
Dependencies
No dependencies set.
Reference: sloum/bombadillo#148
Loading…
Reference in New Issue
No description provided.
Delete Branch "gemini-alt-text"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Adds the option
geminiblocks
with the valid types:block
,alt
,neither
,both
.This is intended to be an accessibility fix that is slightly ahead of the spec. My hope is to make it a working model for moving forward with alt text associated with preformatted text blocks.
When set to block you will just see the contents of the preformatted block. Alt will show just the alt text, if it exists. Neither and both do what they sound like.
This also brings things more inline with the spec by using
strings.HasPrefix(str, "```")
to detect preformatted lines. The main branch currently looks for the exact line\n which will break with alt text or accidental whitespace. The spec specifically states that any line that starts with
should toggle on or off a preformatted block.Lastly, the previous way of handling blocks still allowed links to be rendered within a preformatted block, which is against the spec. This patch resolves that issue, which will allow text/gemini to self document itself more easily.
A good page to test this with is: gemini://rawtext.club/~sloum/test.gmi
It is very short and simple, but contains alt text. Unlike many features in Bombadillo, you need to refresh/reload the page (
R
) to see a change to the setting due to needing to reparse the document.