3IGFCRNEH3FIUWUFVRDDTGP3SRNPEJCWB3ELVEK6R45PRYXDKNSAC
end
-- Make [[WikiWords]] (single word, all in one screen line) clickable.
local trimmed_word = rtrim(frag) -- compute_fragments puts whitespace at the end
if starts_with(trimmed_word, '[[') and ends_with(trimmed_word, ']]') then
local filename = trimmed_word:gsub('^..(.*)..$', '%1')
if source.link_exists(State, filename) then
local filename_text = App.newText(love.graphics.getFont(), filename)
button(State, 'link', {x=x+App.width(to_text('[[')), y=y, w=App.width(filename_text), h=State.line_height, color={1,1,1},
icon = icon.hyperlink_decoration,
onpress1 = function()
source.switch_to_file(filename)
end,
})
end
-- Make [[WikiWords]] (single word, all in one screen line) clickable.
local trimmed_word = rtrim(frag) -- compute_fragments puts whitespace at the end
if starts_with(trimmed_word, '[[') and ends_with(trimmed_word, ']]') then
local filename = trimmed_word:gsub('^..(.*)..$', '%1')
if source.link_exists(State, filename) then
local filename_text = App.newText(love.graphics.getFont(), filename)
button(State, 'link', {x=x+App.width(to_text('[[')), y=y, w=App.width(filename_text), h=State.line_height, color={1,1,1},
icon = icon.hyperlink_decoration,
onpress1 = function()
source.switch_to_file(filename)
end,
})
end
end
function source.link_exists(State, filename)
if State.link_cache == nil then
State.link_cache = {}
end
if State.link_cache[filename] == nil then
State.link_cache[filename] = file_exists(filename)
end
return State.link_cache[filename]
end
State.link_cache = {}
end
end