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

[BUG] code block对C# Razor/Blazor的渲染有问题 #1599

Open
jeffgyf opened this issue Nov 3, 2024 · 1 comment
Open

[BUG] code block对C# Razor/Blazor的渲染有问题 #1599

jeffgyf opened this issue Nov 3, 2024 · 1 comment

Comments

@jeffgyf
Copy link

jeffgyf commented Nov 3, 2024

Bug Description
Razor是C# Blazor UI框架使用的混合了html和C#的语法,在chatbox的markdown code block中渲染时会出现错误,C#部分会被重新错误地排版

image

正确的应该是

@page "/counter"
@using System.ComponentModel.DataAnnotations

<div class="container">
    <h1>helloworld</h1>
</div>

@code {
    private int currentCount = 0;
    private UserModel userModel = new();

    private void IncrementCount()
    {
        currentCount++;
    }

    private void HandleValidSubmit()
    {
        // Handle the valid form submission
        Console.WriteLine($"Form submitted for {userModel.UserName}");
    }

    public class UserModel
    {
        [Required]
        [StringLength(50, MinimumLength = 3)]
        public string UserName { get; set; } = string.Empty;

        [Required]
        [EmailAddress]
        public string Email { get; set; } = string.Empty;
    }
}

希望能按照原有markdown内容来显示,不进行额外的重新排版。

@pythonsan
Copy link

python的代码也有问题,缩进不对

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

No branches or pull requests

2 participants