MarkdownSharp & GitHub syntax for C# code

前端 未结 3 1313
离开以前
离开以前 2020-12-28 14:20

Is there a way to get MarkdownSharp (I\'m using the NuGet package) to handle \'GitHub flavored Markdown (GFM)\' and especially syntax highlighting of c# code, which (in GFM)

3条回答
  •  Happy的楠姐
    2020-12-28 15:11

    I have made some light modifications to MarkdownSharp that will transform github flavored fenced code blocks

    https://github.com/KyleGobel/MarkdownSharp-GithubCodeBlocks

    ```cs
    Console.WriteLine("Fenced code blocks ftw!");
    ```
    

    Would become

    
    Console.WriteLine("Fenced code blocks ftw!");
    

    It handles the cases I needed to use, there are probably lots of edge cases though, feel free to fork/change/modify/pull request. Markdown sharp has plenty of comments and is all only one file, so it's not too bad to modify.

提交回复
热议问题