1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-29 22:45:44 +00:00
This commit is contained in:
Yan Maniez 2018-10-24 20:11:00 +02:00
commit cd04a875dd
5 changed files with 42 additions and 1 deletions

View file

@ -105,8 +105,40 @@ namespace AideDeJeuLib
[DataMember]
[Indexed]
public string RootId { get; set; }
[DataMember]
[Indexed]
public string ParentLink { get; set; }
[DataMember]
public string Name { get; set; }
[DataMember]
public string ParentName { get; set; }
[IgnoreDataMember]
[Ignore]
public string ParentNameLink
{
get
{
if (ParentName != null && ParentLink != null)
{
return $"<!--ParentNameLink-->[{ParentName}]({ParentLink})<!--/ParentNameLink-->";
}
return null;
}
set
{
if (value != null)
{
var regex = new Regex("\\[(?<name>.*?)\\]\\((?<link>.*?)\\)");
var match = regex.Match(value);
ParentName = match.Groups["name"].Value;
ParentLink = match.Groups["link"].Value;
}
}
}
[DataMember]
public int NameLevel { get; set; }
[DataMember]
@ -138,5 +170,7 @@ namespace AideDeJeuLib
public string Source { get; set; }
[DataMember]
public virtual string Markdown { get; set; }
[DataMember]
public string FullText { get; set; }
}
}

View file

@ -75,6 +75,9 @@ namespace AideDeJeu.ViewModels
else if (IsNewItem(block))
{
var subItem = ParseItem(source, ref enumerator, allItems);
subItem.ParentLink = GetNewAnchorId(source, currentItem.Name, allItems);
subItem.ParentName = currentItem.Name;
subItem.Markdown = $"> {subItem.ParentNameLink}\n\n---\n\n{subItem.Markdown}";
var propertyName = subItem.GetType().Name;

View file

@ -1,6 +1,10 @@
<!--Generic-->
> <!--ParentNameLink-->[Races](races_hd.md#races)<!--/ParentNameLink-->
---
# <!--Name-->Aasimar<!--/Name-->
- Source: <!--Source-->(MDR p59)<!--/Source-->

Binary file not shown.

View file

@ -1 +1 @@
6
8