Open GilbertoTheMighty opened 1 year ago
c# code is not highlighted,
What lang-code do you use for codeblock?
For now, MdXaml recognizes only cs
to display C# code.
The bellow code is highlighted.
```cs
using System;
class Main{}
The bellow code is not highlighted.
using System;
class Main{}
Thank you! Using replace on incoming string did the trick. How can I configure styles for different langs in codeblock?
MdXaml v1.20.1 has been released. This version enables the addition of syntax highlighting rules.
To add syntax highlighting, use MdXamlPlugins.Highlights
.
sample: App.xaml
<!-- xmlns:mdplugins="clr-namespace:MdXaml.Plugins;assembly=MdXaml.Plugins" -->
<Application ...>
<Application.Resources>
<mdplugins:MdXamlPlugins x:Key="MdXamlPlugins">
<mdplugins:MdXamlPlugins.Highlights>
<!--
Create a new alias from the xshd file.
Multiple alias names can be indicated by separating them with ",".
In this case pegasus and peg.
-->
<mdplugins:Definition Alias="pegasus,peg" Resource="pack://application:,,,/Asset/Pegasus-Mode.xshd" />
<!--
Alias an already defined langcode (in this case javascript).
-->
<mdplugins:Definition Alias="typescript,ts" RealName="javascript" />
</mdplugins:MdXamlPlugins.Highlights>
</mdplugins:MdXamlPlugins>
</Application.Resources>
</Application>
markdown sample
```peg
@namespace PegExamples
@classname SignificantWhitespaceParser
@using System.Linq
program <object>
= s:"Hello" {s}
===
const message="Hello world!"
console.log(message)
How to configure syntax style for different codeBlock languages?