mwg API
    Preparing search index...

    Interface MarkdownSpan

    Minimal inline markdown for UI text: bold and italic spans, nothing block-level. **bold** and __bold__ render bold, *italic* and _italic_ italic (including the combined ***both***), a backslash escapes a marker (\* stays a literal asterisk), and anything unmatched stays literal text rather than vanishing.

    Pure logic, no Pixi dependency: parseMarkdown turns a string into styled spans for RichLabel to draw, and stripMarkdown recovers the plain text (for measuring, accessibility names, or any widget that stays single-style). Headings, links, lists and code spans are deliberately out - a game label needs emphasis inside a sentence, not a document renderer.

    An underscore run inside a word (treasure_map) is not emphasis, matching CommonMark; asterisks always are (a*b*c italicizes b). Markers pair strictly sequentially per kind (**a** **b** is two spans), so exotic nesting degrades to literal markers rather than surprising styling.

    import { parseMarkdown, stripMarkdown } from '@datamoc/mw_games/two-d/ui';

    parseMarkdown('Take **two** *small* coins');
    // [{ text: 'Take ', bold: false, italic: false },
    // { text: 'two', bold: true, italic: false },
    // { text: ' ', bold: false, italic: false },
    // { text: 'small', bold: false, italic: true },
    // { text: ' coins', bold: false, italic: false }]

    stripMarkdown('Take **two** coins'); // 'Take two coins'
    interface MarkdownSpan {
        bold: boolean;
        italic: boolean;
        text: string;
    }

    Hierarchy (View Summary)

    Index
    bold: boolean
    italic: boolean
    text: string