Closed dayAndnight2018 closed 2 years ago
`
`
Are you trying to apply a style to syntax-highlighting code block? For syntax-highlighting code block, a style should be apply to TextEditor in AvaloniaEdit.
<!--
xmlns:md="clr-namespace:Markdown.Avalonia;assembly=Markdown.Avalonia"
xmlns="https://github.com/avaloniaui"
xmlns:avedit="https://github.com/avaloniaui/avaloniaedit"
xmlns:ctxt="clr-namespace:ColorTextBlock.Avalonia;assembly=ColorTextBlock.Avalonia"
-->
<md:MarkdownScrollViewer>
<md:MarkdownScrollViewer.Styles>
<Style Selector="ctxt|CCode">
<Style.Setters>
<Setter Property="MonospaceFontFamily" Value="Niagara Solid" />
<Setter Property="FontSize" Value="20" />
</Style.Setters>
</Style>
<Style Selector="TextBlock.CodeBlock">
<Style.Setters>
<Setter Property="FontFamily" Value="MV Boli" />
</Style.Setters>
</Style>
<Style Selector="avedit|TextEditor">
<Setter Property="FontFamily" Value="Old English Text MT" />
</Style>
</md:MarkdownScrollViewer.Styles>
Sample:
``Code Span``
---
// TextBlock.CodeBlock //
int main(){ return 0; }
---
```c
// AvaloniaEdit.TextEditor //
int main(){
return 0;
}
</md:MarkdownScrollViewer>
![image](https://user-images.githubusercontent.com/13712028/164716438-6258e5a8-de9e-4194-880a-76a4f83a0c72.png)
Thanks a lot, that works now
I want to write annotations in CodeBlock, set the fontfamily style and MonospaceFontFamily style but no work.