Skip to content

Commit 5624f79

Browse files
authored
Merge pull request #595 from jcoc611-microsoft/user/juosori/temp_fenced_code_block
MarkdownTextBlock: Temporary fix for Fenced code block rendering
2 parents 6dafb91 + 8ea040f commit 5624f79

File tree

1 file changed

+11
-8
lines changed

1 file changed

+11
-8
lines changed

components/MarkdownTextBlock/src/TextElements/MyCodeBlock.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ public MyCodeBlock(CodeBlock codeBlock, MarkdownConfig config)
3030
border.CornerRadius = _config.Themes.CornerRadius;
3131
var richTextBlock = new RichTextBlock();
3232

33+
#if false
3334
if (codeBlock is FencedCodeBlock fencedCodeBlock)
3435
{
3536
//#if !WINAPPSDK
@@ -68,17 +69,19 @@ public MyCodeBlock(CodeBlock codeBlock, MarkdownConfig config)
6869
}
6970
else
7071
{
71-
foreach (var line in codeBlock.Lines.Lines)
72+
#endif
73+
74+
foreach (var line in codeBlock.Lines.Lines)
75+
{
76+
var paragraph = new Paragraph();
77+
var lineString = line.ToString();
78+
if (!String.IsNullOrWhiteSpace(lineString))
7279
{
73-
var paragraph = new Paragraph();
74-
var lineString = line.ToString();
75-
if (!String.IsNullOrWhiteSpace(lineString))
76-
{
77-
paragraph.Inlines.Add(new Run() { Text = lineString });
78-
}
79-
richTextBlock.Blocks.Add(paragraph);
80+
paragraph.Inlines.Add(new Run() { Text = lineString });
8081
}
82+
richTextBlock.Blocks.Add(paragraph);
8183
}
84+
8285
border.Child = richTextBlock;
8386
container.Child = border;
8487
_paragraph.Inlines.Add(container);

0 commit comments

Comments
 (0)