HtmlReaderContext Class
Definition
Context provided to Avalonia.Controls.Documents.Serialization.Html.IHtmlTagHandler implementations. Exposes safe builder operations without granting full builder access.
public class HtmlReaderContext
Methods
| Name | Description |
|---|---|
| AddLineBreak | Adds a line break inline. |
| CloseParagraph | Closes the current paragraph (if open). |
| EnsureParagraph | Ensures a paragraph is open, creating one if needed. |
| PopInline | Pops the current formatting inline. |
| PushInline | Pushes a formatting inline onto the stack. |
| WriteText | Writes 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
| Name | Description |
|---|---|
| CurrentTagContent | The tag content span from the current token, for attribute parsing. |
| IsInsideParagraph | Whether 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; }