mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-29 22:45:44 +00:00
Test markdown to html pour la description
This commit is contained in:
parent
ab4758555b
commit
474b879b57
1 changed files with 9 additions and 2 deletions
|
|
@ -7,6 +7,7 @@ using System.Threading.Tasks;
|
|||
using System.Linq;
|
||||
using System.Diagnostics;
|
||||
using AideDeJeuLib.Monsters;
|
||||
using Markdig;
|
||||
|
||||
namespace AideDeJeu.Tools
|
||||
{
|
||||
|
|
@ -24,6 +25,12 @@ namespace AideDeJeu.Tools
|
|||
return document.ToMonsters();
|
||||
}
|
||||
|
||||
public static string MarkdownToHtml(string md)
|
||||
{
|
||||
var pipeline = new MarkdownPipelineBuilder().UsePipeTables().Build();
|
||||
return Markdown.ToHtml(md, pipeline);
|
||||
}
|
||||
|
||||
public static IEnumerable<Spell> ToSpells(this Markdig.Syntax.MarkdownDocument document)
|
||||
{
|
||||
var spells = new List<Spell>();
|
||||
|
|
@ -50,7 +57,7 @@ namespace AideDeJeu.Tools
|
|||
if (block is Markdig.Syntax.ParagraphBlock)
|
||||
{
|
||||
var paragraphBlock = block as Markdig.Syntax.ParagraphBlock;
|
||||
spell.DescriptionHtml += paragraphBlock.ToParagraphString();
|
||||
spell.DescriptionHtml += MarkdownToHtml(paragraphBlock.ToParagraphString());
|
||||
////DumpParagraphBlock(paragraphBlock);
|
||||
//Console.WriteLine(paragraphBlock.IsBreakable);
|
||||
//spell.DescriptionHtml += paragraphBlock.Inline.ToContainerString();
|
||||
|
|
@ -131,7 +138,7 @@ namespace AideDeJeu.Tools
|
|||
if (ininblock is Markdig.Syntax.ParagraphBlock)
|
||||
{
|
||||
var paragraphBlock = ininblock as Markdig.Syntax.ParagraphBlock;
|
||||
spell.DescriptionHtml += listBlock.BulletType + " " + paragraphBlock.ToParagraphString();
|
||||
spell.DescriptionHtml += listBlock.BulletType + " " + MarkdownToHtml(paragraphBlock.ToParagraphString());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue