Packages
Multi-surface application runtime for Elixir. One TEA module renders to terminal, browser (LiveView), SSH, and MCP (agents). 30+ widgets, flexbox + CSS grid, AI agent runtime, distributed swarm with CRDTs, time-travel debugging, session recording, sandboxed REPL, and agentic commerce.
Current section
Files
Jump to
Current section
Files
lib/raxol/terminal/commands/osc_handler/hyperlink_parser.ex
defmodule Raxol.Terminal.Commands.OSCHandler.HyperlinkParser do
@moduledoc false
@spec parse(String.t()) ::
{:query, String.t()}
| {:set, String.t(), String.t()}
| {:clear, String.t()}
| {:error, term()}
def parse(data) do
case data do
"?'" ->
{:query, "'"}
str when is_binary(str) ->
case String.split(str, ";") do
[id, ""] ->
{:clear, id}
[id, url] when is_binary(id) and is_binary(url) ->
{:set, id, url}
_ ->
{:error, :invalid_format}
end
_ ->
{:error, :invalid_data}
end
end
end