Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Style rendering is incomplete #794

Open
Geek-Bob opened this issue Apr 30, 2024 · 1 comment
Open

Style rendering is incomplete #794

Geek-Bob opened this issue Apr 30, 2024 · 1 comment
Labels

Comments

@Geek-Bob
Copy link

code

        var str = "C#(发音为 \"C sharp\")是一种现代、面向对象的编程语言,由微软公司开发并在2000年首次发布,作为.NET框架的一部分。C#设计旨在提高开发效率,兼具强大的类型系统和现代编程特性,适用于从网页应用到桌面软件,再到游戏开发和企业级解决方案的广泛领域。\n\n### C# 的核心特性与概念\n\n#### 基础概念\n1. **强类型语言** - C#要求变量在使用前声明其类型,减少类型错误。\n2. **面向对象编程 (OOP)** - 支持类、对象、继承、封装、多态等概念。\n3. **垃圾回收 (GC)** - 自动管理内存,减少程序员手动分配和释放内存的工作。\n\n#### 进阶特性\n1. **LINQ (Language Integrated Query)** - 语言集成查询,允许以SQL类似的方式操作内存中的数据。\n2. **异步编程** - 使用async/await关键字简化异步操作的编写。\n3. **Lambda 表达式** - 简洁地定义匿名函数。\n4. **属性 (Properties)** - 提供访问私有字段的公共接口,支持数据验证逻辑。\n5. **泛型** - 支持编写可重用的类型安全的集合和方法。\n\n### C# 发展历程简表\n\n| 版本 | 发布年份 | 主要特性 |\n| --- | --- | --- |\n| 1.0 | 2002 | 初始版本,伴随.NET Framework 1.0发布 |\n| 2.0 | 2005 | 泛型、匿名方法、迭代器 |\n| 3.0 | 2007 | LINQ、Lambda表达式、隐式类型局部变量 |\n| 4.0 | 2010 | 动态类型、命名实参、异步编程模型的初步形态 |\n| 5.0 | 2012 | async/await、Caller Info Attributes |\n| 6.0 | 2015 | Roslyn编译器、字符串插值、异常过滤器 |\n| 7.0 | 2017 | 出栈变量、模式匹配、元组 |\n| 8.0 | 2019 | 默认接口方法、范围索引、可空引用类型 |\n| 9.0 | 2020 | 拓展方法上的顶级语句、目标类型新语法 |\n\n### Hello World 示例代码\n\n```csharp\nusing System;\n\nclass HelloWorld\n{\n    static void Main()\n    {\n        Console.WriteLine(\"Hello, World!\");\n    }\n}\n```\n\n在这段代码中,`using System;` 引入了System命名空间,其中包含Console类,用于输出文本到控制台。`Main` 方法是程序的入口点,而 `Console.WriteLine(\"Hello, World!\");` 这行代码则打印出经典的“Hello, World!”问候语。";
        var html = Markdown.ToHtml(str);

Problem description

For example: font title size, font background color, table border, table line background color, code block

Normal style

Snipaste_2024-04-30_14-22-51

[markdig] Style rendering

Snipaste_2024-04-30_14-42-54
@MihaZupan
Copy link
Collaborator

Things like tables aren't enabled by default. You must opt-in by adding additional extensions, e.g. UseAdvancedExtensions.

var pipeline = new MarkdownPipelineBuilder()
    .UseAdvancedExtensions()
    .Build();

string html = Markdown.ToHtml(content, pipeline);

Markdig won't add CSS for you -- styling is left up to you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants