mirror of
https://github.com/Nioux/AideDeJeu.git
synced 2025-10-30 15:06:06 +00:00
Test avec liens "invisibles"
This commit is contained in:
parent
4186a8e920
commit
2440a2a57b
2 changed files with 24 additions and 2 deletions
|
|
@ -10,6 +10,8 @@ using AideDeJeuLib.Monsters;
|
||||||
using Markdig;
|
using Markdig;
|
||||||
using AideDeJeuLib;
|
using AideDeJeuLib;
|
||||||
using AideDeJeuLib.Conditions;
|
using AideDeJeuLib.Conditions;
|
||||||
|
using Markdig.Syntax;
|
||||||
|
using Markdig.Syntax.Inlines;
|
||||||
|
|
||||||
namespace AideDeJeu.Tools
|
namespace AideDeJeu.Tools
|
||||||
{
|
{
|
||||||
|
|
@ -54,7 +56,26 @@ namespace AideDeJeu.Tools
|
||||||
enumerator.MoveNext();
|
enumerator.MoveNext();
|
||||||
while (enumerator.Current != null)
|
while (enumerator.Current != null)
|
||||||
{
|
{
|
||||||
if(enumerator.Current is Markdig.Syntax.LinkReferenceDefinitionGroup)
|
if (enumerator.Current is Markdig.Syntax.ParagraphBlock)
|
||||||
|
{
|
||||||
|
var paragraphBlock = enumerator.Current as ParagraphBlock;
|
||||||
|
var linkInline = paragraphBlock.Inline.FirstChild as LinkInline;
|
||||||
|
if(linkInline != null)
|
||||||
|
{
|
||||||
|
var label = linkInline.Label;
|
||||||
|
var title = linkInline.Title;
|
||||||
|
var url = linkInline.Url;
|
||||||
|
if (title == "")
|
||||||
|
{
|
||||||
|
var name = $"AideDeJeuLib.{label}, AideDeJeu";
|
||||||
|
var type = Type.GetType(name);
|
||||||
|
var instance = Activator.CreateInstance(type) as Item;
|
||||||
|
instance.Parse(ref enumerator);
|
||||||
|
return instance;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (enumerator.Current is Markdig.Syntax.LinkReferenceDefinitionGroup)
|
||||||
{
|
{
|
||||||
var linkReferenceDefinitionGroup = enumerator.Current as Markdig.Syntax.LinkReferenceDefinitionGroup;
|
var linkReferenceDefinitionGroup = enumerator.Current as Markdig.Syntax.LinkReferenceDefinitionGroup;
|
||||||
var linkReferenceDefinition = linkReferenceDefinitionGroup.FirstOrDefault() as Markdig.Syntax.LinkReferenceDefinition;
|
var linkReferenceDefinition = linkReferenceDefinitionGroup.FirstOrDefault() as Markdig.Syntax.LinkReferenceDefinition;
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
|
|
||||||
[//]: # (Items)
|
[][Items]
|
||||||
|
|
||||||
[][SpellHD]
|
[][SpellHD]
|
||||||
|
|
||||||
|
[Items]: #Items
|
||||||
[SpellHD]: #SpellHD
|
[SpellHD]: #SpellHD
|
||||||
|
|
||||||
# Agrandir/rétrécir
|
# Agrandir/rétrécir
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue