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
raxol lib raxol core text_processor.ex
Raw

lib/raxol/core/text_processor.ex

defmodule Raxol.Core.TextProcessor do
@moduledoc """
Handles text processing and formatting for UI elements.
"""
@doc """
Processes a text element map and returns a processed version with proper formatting.
"""
def process_text_element(text_map, space) do
text = Map.get(text_map, :text, "")
style = Map.get(text_map, :style, %{})
width = String.length(text)
height = 1
width = min(width, space.width)
Map.merge(text_map, %{
text: text,
style: style,
width: width,
height: height
})
end
end