Implement a simple Markdown parser that converts a plain-text string with inline formatting into a list of formatted segments. The only formatting markers you need to support are ** for bold and * for italic. A marker toggles the corresponding style on and off; when a style is active it applies to every character until the matching closing marker. Segments are contiguous runs of text that share the same set of active styles. You must process the input left-to-right, always checking for the two-character marker ** before the single-character marker * so that ** is never mis-interpreted as two separate italic markers. If a marker appears that has no matching closing marker, treat it as plain text. Nested usage (e.g. italic inside bold) should be handled naturally by the toggle rules. Return an array (or list) of segments, each segment containing the text substring and the set of active styles at that moment (e.g. ["bold", "italic"], ["bold"], or []).