State
Object Hierarchy:
Description:
public class State
Represents a single piece of styling in the markdown renderer.
Each State represents a single styling element (e.g., italic, bold, paragraph, header). States manage their own buffer and marks for tag
positions.
Content:
Properties:
- public ArrayList<State> cn { get; }
- protected TextMark? end { public get; public set; }
- public State? parent { get; }
- public Render render { get; }
- protected TextMark? start { public get; public set; }
- public TextTag? style { get; protected set; }
Creation methods:
Methods:
- public State add_state (TextTag? use_tag = null)
Creates a child state. If use_tag is non-null, the child reuses that
tag for styling.
- public void add_text (string text)
Adds text directly to the text buffer at the current insertion point.
Inserts plain text and applies the TextTag to the inserted range.
- public virtual void close_state ()
Closes this state, pops to parent, and updates Render's current_state.
- public void copy_style_to (State target)
Copies style properties from this state to the target state. Used to
restore default formatting when new textviews are created.
- protected virtual void update_ranges_from (State child)
Updates this state's end range to match the child's end and applies
this state's tag. Also recursively updates parent states.