#pragma once #include #include namespace roro::gemini { enum class LineType { Text, Link, Heading1, Heading2, Heading3, ListItem, Quote, PreToggle, Preformatted }; // One gemtext line. Link: `url` and its label in `text` (the URL itself without a label). // PreToggle: the ``` line, with its alt text. Preformatted: kept exactly. struct GemLine { LineType type = LineType::Text; std::string text, url; }; // One line; `preformatted` carries the ``` state from line to line (start with false). GemLine parseGemLine(const std::string& line, bool& preformatted); std::vector parseGemtext(const std::string& document); // For the Latin-1 fonts (Q79): valid UTF-8 up to U+00FF kept, anything else '?', and tabs // expanded to 4-column stops. std::string displayText(const std::string& utf8); } // namespace roro::gemini