Skip to main content

HtmlReaderContext Class

Definition​

Assembly:Avalonia.Controls.Documents.Serialization.Html
Package:Avalonia.Controls.Documents.Serialization.Html

Context provided to Avalonia.Controls.Documents.Serialization.Html.IHtmlTagHandler implementations. Exposes safe builder operations without granting full builder access.

public class HtmlReaderContext

Inheritance: object -> HtmlReaderContext

Methods​

NameDescription
AddLineBreakAdds a line break inline.
CloseParagraphCloses the current paragraph (if open).
EnsureParagraphEnsures a paragraph is open, creating one if needed.
PopInlinePops the current formatting inline.
PushInlinePushes a formatting inline onto the stack.
WriteTextWrites text with the current inline formatting.

AddLineBreak Method​

Adds a line break inline.

public void AddLineBreak()

CloseParagraph Method​

Closes the current paragraph (if open).

public void CloseParagraph()

EnsureParagraph Method​

Ensures a paragraph is open, creating one if needed.

public void EnsureParagraph()

PopInline Method​

Pops the current formatting inline.

public void PopInline()

PushInline Method​

Pushes a formatting inline onto the stack.

public void PushInline(Avalonia.Controls.Documents.Serialization.Authoring.InlineDraft inline)

Parameters​

inline Avalonia.Controls.Documents.Serialization.Authoring.InlineDraft

WriteText Method​

Writes text with the current inline formatting.

public void WriteText(string text)

Parameters​

text string

Properties​

NameDescription
CurrentTagContentThe tag content span from the current token, for attribute parsing.
IsInsideParagraphWhether there is currently an open paragraph.

CurrentTagContent Property​

The tag content span from the current token, for attribute parsing.

public ReadOnlyMemory<char> CurrentTagContent { get; set; }

IsInsideParagraph Property​

Whether there is currently an open paragraph.

public bool IsInsideParagraph { get; set; }