Skip to content

Commit

Permalink
Merge pull request #595 from jcoc611-microsoft/user/juosori/temp_fenc…
Browse files Browse the repository at this point in the history
…ed_code_block

MarkdownTextBlock: Temporary fix for Fenced code block rendering
  • Loading branch information
Arlodotexe authored Nov 26, 2024
2 parents 6dafb91 + 8ea040f commit 5624f79
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions components/MarkdownTextBlock/src/TextElements/MyCodeBlock.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public MyCodeBlock(CodeBlock codeBlock, MarkdownConfig config)
border.CornerRadius = _config.Themes.CornerRadius;
var richTextBlock = new RichTextBlock();

#if false
if (codeBlock is FencedCodeBlock fencedCodeBlock)
{
//#if !WINAPPSDK
Expand Down Expand Up @@ -68,17 +69,19 @@ public MyCodeBlock(CodeBlock codeBlock, MarkdownConfig config)
}
else
{
foreach (var line in codeBlock.Lines.Lines)
#endif

foreach (var line in codeBlock.Lines.Lines)
{
var paragraph = new Paragraph();
var lineString = line.ToString();
if (!String.IsNullOrWhiteSpace(lineString))
{
var paragraph = new Paragraph();
var lineString = line.ToString();
if (!String.IsNullOrWhiteSpace(lineString))
{
paragraph.Inlines.Add(new Run() { Text = lineString });
}
richTextBlock.Blocks.Add(paragraph);
paragraph.Inlines.Add(new Run() { Text = lineString });
}
richTextBlock.Blocks.Add(paragraph);
}

border.Child = richTextBlock;
container.Child = border;
_paragraph.Inlines.Add(container);
Expand Down

0 comments on commit 5624f79

Please sign in to comment.