1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-12-20 17:13:31 +00:00

Gestion du <br> dans le markdown

This commit is contained in:
Yan Maniez 2018-08-12 00:33:50 +02:00
parent 91f21e3c54
commit a9a827e2e5
4 changed files with 64 additions and 75 deletions

View file

@ -179,6 +179,11 @@ namespace AideDeJeu.Tools
var containerInline = inline as Markdig.Syntax.Inlines.ContainerInline;
add = containerInline.ToMarkdownString();
}
else if (inline is Markdig.Syntax.Inlines.HtmlInline)
{
var htmlInline = inline as Markdig.Syntax.Inlines.HtmlInline;
add = htmlInline.Tag;
}
else
{
add = inline.ToString();

View file

@ -607,6 +607,23 @@
},
};
case HtmlInline html:
if (html.Tag == "<br>")
{
return new[]
{
new Span()
{
Text="\r\n",
FontSize = size,
FontFamily = family,
ForegroundColor = foregroundColor,
BackgroundColor = backgroundColor
},
};
}
return null;
default:
Debug.WriteLine($"Can't render {inline.GetType()} inlines.");
return null;