Describe the bug
Summary
The Markdown styling documentation
instructs users to style inline code spans with the selector RichRun.code. In the
shipping control, the code class is applied to a RichSpan, not a RichRun, so
the documented RichRun.code selector matches no elements and has no effect.
The working selector is RichSpan.code.
Environment
Avalonia.Controls.Markdown 12.1.2
Avalonia 12.0.3
- OS: Windows
- Docs page last updated: May 14, 2026
Where the docs say RichRun.code
Two places on the styling page:
-
Available selectors table:
RichRun.code — Inline code spans. Background and monospace font.
-
Custom styling example:
<Style Selector="RichRun.code">
<Setter Property="Background" Value="#e8f0fe" />
<Setter Property="FontFamily" Value="Cascadia Code" />
</Style>
To Reproduce
<Style Selector="RichRun.code">
<Setter Property="Background" Value="#e8f0fe" />
<Setter Property="FontFamily" Value="Cascadia Code" />
</Style>
Expected behavior
Expected vs. Actual
Expected: Following the docs, Style Selector="RichRun.code" styles inline code spans.
Actual: The selector matches zero elements. Inline code retains its default
appearance. Switching the selector to RichSpan.code works immediately.
Avalonia version
12.0.3
OS
Windows
Additional context
Suggested fix
Update the selector table entry and the custom-styling example from RichRun.code to
RichSpan.code:
Describe the bug
Summary
The Markdown styling documentation
instructs users to style inline code spans with the selector
RichRun.code. In theshipping control, the
codeclass is applied to aRichSpan, not aRichRun, sothe documented
RichRun.codeselector matches no elements and has no effect.The working selector is
RichSpan.code.Environment
Avalonia.Controls.Markdown12.1.2Avalonia12.0.3Where the docs say
RichRun.codeTwo places on the styling page:
Available selectors table:
Custom styling example:
To Reproduce
Expected behavior
Expected vs. Actual
Expected: Following the docs, Style Selector="RichRun.code" styles inline code spans.
Actual: The selector matches zero elements. Inline code retains its default
appearance. Switching the selector to RichSpan.code works immediately.
Avalonia version
12.0.3
OS
Windows
Additional context
Suggested fix
Update the selector table entry and the custom-styling example from RichRun.code to
RichSpan.code: