-
Notifications
You must be signed in to change notification settings - Fork 51
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
MarkdownTextBlock MyCodeBlock renders empty RichTextBox as doesn't use StringBuilder for anything #547
Comments
There's actually a handful of issues upon looking over it a bit closer, so far I've identified the following: Newlines are not handled so there's no spacing between paragraphs if there's empty lines in the markdown content. Bullets are not indented and there's no spacing betwen the bullet and the first word of the run. Code Block doesn't render the language type and colours as the formatting is commented out, relates directly the the initial problem, easy fix though. Inadvertant spacing - When pasting in code that then gets rendered to a MarkdownTextblock inside of a chat bubble, it adds a lot of whitespace to the bottom of the code block, not sure why yet still looking into that one. |
I have some examples of the spacing and whatnot. I am using var markdownTextBlock = new MarkdownTextBlock()
{
Text = @"DLSS Swapper should find games from your installed game libraries automatically. If your game is not listed there may be a few settings preventing it. Please check:
- Games list filter is not set to ""Hide non-DLSS games""
- Specific game library is enabled in settings
If you have checked these and your game is still not showing up there may be a bug. We would appreciate it if you could report the issue on our GitHub repository so we can make a fix and have your games better detected in the future.",
Background = new SolidColorBrush(Microsoft.UI.Colors.Transparent),
}; In the old v7 version it would generate a window that would look like, After moving to Looking at the examples I could see they were also using a As @JoeTomkinson said, newlines and bullet spacing is broken. Looking at the examples again I can see here is a bunch of var markdownTextBlock = new MarkdownTextBlock()
{
Text = @"DLSS Swapper should find games from your installed game libraries automatically. If your game is not listed there may be a few settings preventing it. Please check:
- Games list filter is not set to ""Hide non-DLSS games""
- Specific game library is enabled in settings
If you have checked these and your game is still not showing up there may be a bug. We would appreciate it if you could report the issue on our GitHub repository so we can make a fix and have your games better detected in the future.",
Background = new SolidColorBrush(Microsoft.UI.Colors.Transparent),
Config = new MarkdownConfig(),
}; which produces this output, It's certainly more readable, and for my in app markdown I can modify text or swap to a formatted textblock of some sort. But I also pull in release notes from GitHub which would then need the Before this goes live it would also be good to get EDIT: I was curious what changelog looks like, Old: New: |
Describe the bug
The 'MyCodeBlock' in the pre-release of the MarkDownTextBlock doesnt actually use the lines of text for anything resulting in empty code blocks. I've attached the class snippet below so you can see what I mean.
components/MarkdownTextBlock/src/TextElements/MyCodeBlock.cs
Steps to reproduce
Expected behavior
Can see the lines of code rendered within the code block.
Screenshots
No response
Code Platform
Windows Build Number
Other Windows Build number
No response
App minimum and target SDK version
Other SDK version
No response
Visual Studio Version
2022
Visual Studio Build Number
No response
Device form factor
Desktop
Additional context
No response
Help us help you
Yes, but only if others can assist.
The text was updated successfully, but these errors were encountered: