mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 15:36:07 +00:00 
			
		
		
		
	Parsing
This commit is contained in:
		
							parent
							
								
									47d742a159
								
							
						
					
					
						commit
						9222fcd9bf
					
				
					 1 changed files with 136 additions and 134 deletions
				
			
		|  | @ -133,7 +133,7 @@ namespace AideDeJeuCmd | ||||||
|             var anchors = new List<string>(); |             var anchors = new List<string>(); | ||||||
|             var allitems = new Dictionary<string, Item>(); |             var allitems = new Dictionary<string, Item>(); | ||||||
|             var names = Helpers.GetResourceNames(); |             var names = Helpers.GetResourceNames(); | ||||||
|             foreach(var name in names) |             foreach (var name in names) | ||||||
|             { |             { | ||||||
|                 //if (name.Contains("_hd.")) |                 //if (name.Contains("_hd.")) | ||||||
|                 //{ |                 //{ | ||||||
|  | @ -142,7 +142,7 @@ namespace AideDeJeuCmd | ||||||
|                 allitems.Add(name, item); |                 allitems.Add(name, item); | ||||||
|                 //} |                 //} | ||||||
|             } |             } | ||||||
|             foreach(var allitem in allitems) |             foreach (var allitem in allitems) | ||||||
|             { |             { | ||||||
|                 if (allitem.Value is Items) |                 if (allitem.Value is Items) | ||||||
|                 { |                 { | ||||||
|  | @ -156,7 +156,7 @@ namespace AideDeJeuCmd | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|                 else if(allitem.Value != null) |                 else if (allitem.Value != null) | ||||||
|                 { |                 { | ||||||
|                     if (!string.IsNullOrWhiteSpace(allitem.Value.Name)) |                     if (!string.IsNullOrWhiteSpace(allitem.Value.Name)) | ||||||
|                     { |                     { | ||||||
|  | @ -267,15 +267,15 @@ namespace AideDeJeuCmd | ||||||
|                         } |                         } | ||||||
|                         else |                         else | ||||||
|                         { |                         { | ||||||
|                             if(levelType != null) |                             if (levelType != null) | ||||||
|                             { |                             { | ||||||
|                                 await writer.WriteLineAsync(levelType); |                                 await writer.WriteLineAsync(levelType); | ||||||
|                                 if(castingTime != null) await writer.WriteLineAsync(castingTime); |                                 if (castingTime != null) await writer.WriteLineAsync(castingTime); | ||||||
|                                 if(range != null) await writer.WriteLineAsync(range); |                                 if (range != null) await writer.WriteLineAsync(range); | ||||||
|                                 if(components != null) await writer.WriteLineAsync(components); |                                 if (components != null) await writer.WriteLineAsync(components); | ||||||
|                                 if(duration != null) await writer.WriteLineAsync(duration); |                                 if (duration != null) await writer.WriteLineAsync(duration); | ||||||
|                                 if(classes != null) await writer.WriteLineAsync(classes); |                                 if (classes != null) await writer.WriteLineAsync(classes); | ||||||
|                                 if(source != null) await writer.WriteLineAsync(source); |                                 if (source != null) await writer.WriteLineAsync(source); | ||||||
|                                 levelType = null; |                                 levelType = null; | ||||||
|                                 castingTime = null; |                                 castingTime = null; | ||||||
|                                 range = null; |                                 range = null; | ||||||
|  | @ -319,7 +319,7 @@ namespace AideDeJeuCmd | ||||||
|                             var item = store.ToItem(source, md, store._AllItems); |                             var item = store.ToItem(source, md, store._AllItems); | ||||||
|                             if (item != null) |                             if (item != null) | ||||||
|                             { |                             { | ||||||
|                                 if(item.NewId == "hd_aasimar_aasimar.md") |                                 if (item.NewId == "hd_aasimar_aasimar.md") | ||||||
|                                 { |                                 { | ||||||
|                                     Debug.WriteLine(""); |                                     Debug.WriteLine(""); | ||||||
|                                 } |                                 } | ||||||
|  | @ -383,13 +383,14 @@ namespace AideDeJeuCmd | ||||||
|         { |         { | ||||||
|             using (var output = new StreamWriter(@"..\..\..\..\..\Ignore\tome_of_beasts.md", false, Encoding.UTF8)) |             using (var output = new StreamWriter(@"..\..\..\..\..\Ignore\tome_of_beasts.md", false, Encoding.UTF8)) | ||||||
|             { |             { | ||||||
|  |                 var parser = new HtmlParser(); | ||||||
|                 for (int i = 10; i <= 428; i++) |                 for (int i = 10; i <= 428; i++) | ||||||
|                 { |                 { | ||||||
|                     var parser = new HtmlParser(); |  | ||||||
|                     var doc = new HtmlAgilityPack.HtmlDocument(); |                     var doc = new HtmlAgilityPack.HtmlDocument(); | ||||||
|                     doc.Load($@"..\..\..\..\..\Ignore\tome_of_beasts\page{i}.html"); |                     doc.Load($@"..\..\..\..\..\Ignore\tome_of_beasts\page{i}.html"); | ||||||
|                     parser.OutputMarkdown(parser.Parse(doc), output, Console.Error); |                     parser.OutputMarkdown(parser.Parse(doc), output, Console.Error); | ||||||
|                 } |                 } | ||||||
|  |                 output.Write("\n<!--/MonsterItems-->\n"); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | @ -416,6 +417,7 @@ namespace AideDeJeuCmd | ||||||
|                 public string Text; |                 public string Text; | ||||||
|                 public string Style; |                 public string Style; | ||||||
|                 public string IdStyle; |                 public string IdStyle; | ||||||
|  |                 public string DivStyle; | ||||||
|             } |             } | ||||||
|             public class FullLine : List<ParsedSpan> |             public class FullLine : List<ParsedSpan> | ||||||
|             { |             { | ||||||
|  | @ -427,7 +429,7 @@ namespace AideDeJeuCmd | ||||||
|             } |             } | ||||||
|             public FullText Parse(HtmlAgilityPack.HtmlDocument doc) |             public FullText Parse(HtmlAgilityPack.HtmlDocument doc) | ||||||
|             { |             { | ||||||
|                 var styles = doc.DocumentNode.SelectSingleNode(" / html/head/style").InnerText.Split('\n'); |                 var styles = doc.DocumentNode.SelectSingleNode("/html/head/style").InnerText.Split('\n'); | ||||||
|                 var txtDivs = doc.DocumentNode.SelectNodes("//div[@class='txt']"); |                 var txtDivs = doc.DocumentNode.SelectNodes("//div[@class='txt']"); | ||||||
|                 var fullText = new FullText(); |                 var fullText = new FullText(); | ||||||
|                 var fullLine = new FullLine(); |                 var fullLine = new FullLine(); | ||||||
|  | @ -442,16 +444,14 @@ namespace AideDeJeuCmd | ||||||
|                             var spanId = span.GetAttributeValue("id", ""); |                             var spanId = span.GetAttributeValue("id", ""); | ||||||
|                             var spanStyle = span.GetAttributeValue("style", ""); |                             var spanStyle = span.GetAttributeValue("style", ""); | ||||||
|                             var spanIdStyle = new string(styles.SingleOrDefault(s => s.StartsWith($"#{spanId} ")).SkipWhile(c => c != '{').ToArray()); |                             var spanIdStyle = new string(styles.SingleOrDefault(s => s.StartsWith($"#{spanId} ")).SkipWhile(c => c != '{').ToArray()); | ||||||
|  |                             var divStyle = txtDiv.GetAttributeValue("style", ""); | ||||||
|                             var parsedSpan = new ParsedSpan() |                             var parsedSpan = new ParsedSpan() | ||||||
|                             { |                             { | ||||||
|                                 Text = span.InnerText, |                                 Text = span.InnerText, | ||||||
|                                 Style = spanStyle, |                                 Style = spanStyle, | ||||||
|                                 IdStyle = spanIdStyle, |                                 IdStyle = spanIdStyle, | ||||||
|  |                                 DivStyle = divStyle, | ||||||
|                             }; |                             }; | ||||||
|                             if (span.InnerText.Contains("Forme immuable")) |  | ||||||
|                             { |  | ||||||
|                                 Debug.WriteLine(""); |  | ||||||
|                             } |  | ||||||
|                             if (i == 0) |                             if (i == 0) | ||||||
|                             { |                             { | ||||||
|                                 var previousParsedSpan = fullLine.LastOrDefault(); |                                 var previousParsedSpan = fullLine.LastOrDefault(); | ||||||
|  | @ -494,28 +494,24 @@ namespace AideDeJeuCmd | ||||||
|             string st16_255 = "font-size:16px;vertical-align:baseline;color:rgba(255,207,52,1);"; |             string st16_255 = "font-size:16px;vertical-align:baseline;color:rgba(255,207,52,1);"; | ||||||
|             string st11_255 = "font-size:11px;vertical-align:baseline;color:rgba(255,207,52,1);"; |             string st11_255 = "font-size:11px;vertical-align:baseline;color:rgba(255,207,52,1);"; | ||||||
|             string st48_0 = "font-size:48px;vertical-align:baseline;color:rgba(0,0,0,1);"; |             string st48_0 = "font-size:48px;vertical-align:baseline;color:rgba(0,0,0,1);"; | ||||||
|  |             string st14_137 = "font-size:14px;vertical-align:baseline;color:rgba(137,23,26,1);"; | ||||||
|             string st8_0 = "font-size:8px;vertical-align:baseline;color:rgba(0,0,0,1);"; |             string st8_0 = "font-size:8px;vertical-align:baseline;color:rgba(0,0,0,1);"; | ||||||
|             string st8_121 = "font-size:8px;vertical-align:baseline;color:rgba(121,27,16,1);"; |             string st8_121 = "font-size:8px;vertical-align:baseline;color:rgba(121,27,16,1);"; | ||||||
|             string st8_137 = "font-size:8px;vertical-align:baseline;color:rgba(137,23,26,1);"; |             string st8_137 = "font-size:8px;vertical-align:baseline;color:rgba(137,23,26,1);"; | ||||||
|  |             string st9_203 = "font-size:9px;vertical-align:baseline;color:rgba(203,0,0,1);"; | ||||||
|  | 
 | ||||||
|  |             bool started = false; | ||||||
| 
 | 
 | ||||||
|             public void OutputMarkdown(FullText fullText, TextWriter output, TextWriter error) |             public void OutputMarkdown(FullText fullText, TextWriter output, TextWriter error) | ||||||
|             { |             { | ||||||
|                 bool started = false; |                 var page = fullText.Where(l => l.FirstOrDefault().Style.Contains(st16_255))?.FirstOrDefault()?.FirstOrDefault()?.Text; | ||||||
|                 var page = fullText.Where(l => l.FirstOrDefault().Style.Contains("font-size:16px;vertical-align:baseline;color:rgba(255,207,52,1);"))?.FirstOrDefault()?.FirstOrDefault()?.Text; |  | ||||||
|                 Console.ForegroundColor = ConsoleColor.Yellow; |                 Console.ForegroundColor = ConsoleColor.Yellow; | ||||||
|                 output.WriteLine($"Page : {page}"); |                 error.WriteLine($"Page : {page}"); | ||||||
|                 Console.ForegroundColor = ConsoleColor.White; |                 Console.ForegroundColor = ConsoleColor.White; | ||||||
|                 string abilities = null; |                 string abilities = null; | ||||||
|                 foreach (var line in fullText) |                 foreach (var line in fullText) | ||||||
|                 { |                 { | ||||||
|                     var keySpan = line.FirstOrDefault(); |                     var keySpan = line.FirstOrDefault(); | ||||||
|                     //if (keySpan.Style.Contains("font-size:11px")) |  | ||||||
|                     //{   // nom (démarrage) |  | ||||||
|                     //    started = true; |  | ||||||
|                     //} |  | ||||||
|                     //if (started) |  | ||||||
|                     { |  | ||||||
| 
 |  | ||||||
|                     string value = ""; |                     string value = ""; | ||||||
|                     if (line.Count > 1) |                     if (line.Count > 1) | ||||||
|                     { |                     { | ||||||
|  | @ -525,47 +521,49 @@ namespace AideDeJeuCmd | ||||||
|                     error.Write($"{keySpan.Text}"); |                     error.Write($"{keySpan.Text}"); | ||||||
|                     error.WriteLine($" {value}"); |                     error.WriteLine($" {value}"); | ||||||
| 
 | 
 | ||||||
|                         if(keySpan.Style.Contains("font-size:48px;vertical-align:baseline;color:rgba(0,0,0,1);")) |                     if (keySpan.Style.Contains(st48_0) && keySpan.IdStyle.Contains(idsnn)) | ||||||
|                     {   // titre de page |                     {   // titre de page | ||||||
|                             Console.ForegroundColor = ConsoleColor.Red; |                         Console.ForegroundColor = ConsoleColor.Blue; | ||||||
|                             error.Write($"{keySpan.Text}"); |                         error.Write($"{keySpan.Text} {value}\n"); | ||||||
|                             error.WriteLine($" {value}"); |  | ||||||
|                     } |                     } | ||||||
|                         else if (keySpan.Style.Contains("color:rgba(203,0,0,1)")) |                     else if (keySpan.Style.Contains(st9_203) && keySpan.IdStyle.Contains(idssnn)) | ||||||
|                     {   // bloodmark |                     {   // bloodmark | ||||||
|                             Console.ForegroundColor = ConsoleColor.Red; |                         Console.ForegroundColor = ConsoleColor.Blue; | ||||||
|                             error.Write($"{keySpan.Text}"); |                         error.Write($"{keySpan.Text} {value}\n"); | ||||||
|                             error.WriteLine($" {value}"); |  | ||||||
|                     } |                     } | ||||||
|                         else if (keySpan.Style.Contains("font-size:16px;vertical-align:baseline;color:rgba(255,207,52,1);")) |                     else if (keySpan.Style.Contains(st16_255) && keySpan.IdStyle.Contains(idsbn)) | ||||||
|                     {   // page |                     {   // page | ||||||
|                             Console.ForegroundColor = ConsoleColor.Red; |                         Console.ForegroundColor = ConsoleColor.Blue; | ||||||
|                             error.Write($"{keySpan.Text}"); |                         error.Write($"{keySpan.Text} {value}\n"); | ||||||
|                             error.WriteLine($" {value}"); |  | ||||||
|                     } |                     } | ||||||
|                         else if (keySpan.Style.Contains("font-size:8px;vertical-align:baseline;color:rgba(0,0,0,1)") && keySpan.IdStyle.Contains("font-family:serif; font-weight:normal; font-style:normal;")) |                     else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idsnn)) | ||||||
|                     {   // encadré |                     {   // encadré | ||||||
|                             Console.ForegroundColor = ConsoleColor.Red; |                         Console.ForegroundColor = ConsoleColor.Blue; | ||||||
|                             error.Write($"{keySpan.Text}"); |                         error.Write($"{keySpan.Text} {value}\n"); | ||||||
|                             error.WriteLine($" {value}"); |  | ||||||
|                     } |                     } | ||||||
|                         else if (keySpan.Style.Contains("font-size:11px;vertical-align:baseline;color:rgba(255,207,52,1);")) |                     else if (keySpan.Style.Contains(st11_255) && keySpan.IdStyle.Contains(idssnn)) | ||||||
|                     {   // nom |                     {   // nom | ||||||
|                         Console.ForegroundColor = ConsoleColor.White; |                         Console.ForegroundColor = ConsoleColor.White; | ||||||
|                             output.WriteLine($"# <!--Name-->{keySpan.Text}<!--/Name-->"); |                         if(!started) | ||||||
|                             output.WriteLine($""); |                         { | ||||||
|                             output.WriteLine($"- Source: <!--Source-->(LDM p{page})<!--/Source-->"); |                             started = true; | ||||||
|  |                             output.Write("\n<!--MonsterItems Family=\"TomeOfBeasts\" Types=\"Humanoïde|Aberration|Bête|Céleste|Créature artificielle|Créature monstrueuse|Dragon|Élémentaire|Fée|Fiélon|Géant|Mort-vivant|Plante|Vase\" Challenges=\"0 (0 PX)|1/8 (25 PX)|1/4 (50 PX)|1/2 (100 PX)|1 (200 PX)|2 (450 PX)|3 (700 PX)|4 (1100 PX)|5 (1800 PX)|6 (2300 PX)|7 (2900 PX)|8 (3900 PX)|9 (5000 PX)|10 (5900 PX)|11 (7200 PX)|12 (8400 PX)|13 (10000 PX)|14 (11500 PX)|15 (13000 PX)|16 (15000 PX)|17 (18000 PX)|18 (20000 PX)|19 (22000 PX)|20 (25000 PX)|21 (33000 PX)|22 (41000 PX)|23 (50000 PX)|24 (62000 PX)|30 (155000 PX)\" Sizes=\"TP|P|M|G|TG|Gig\" Sources=\"CEO|SRD\" Terrains=\"Arctique / Subarctique|Bois / Forêt|Collines / Vallées|Désert chaud|Jungle|Littoral|Mangrove / Marécage|Mer / Océan|Montagnes|Plaine / Champs / Prairie / Savane|Plans élémentaires|Caverne aménagée|Caverne naturelle|Caverne sous-marine|Donjon maçonné|Ruines extérieures|Ruines souterraines|Ruines sous-marines\"-->\n\n"); | ||||||
|  |                             output.Write("# <!--Name-->Livre des monstres<!--/Name-->\n\n"); | ||||||
|                         } |                         } | ||||||
|                         //else if (!keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:normal;") && CloseKeyValue()) |                         else | ||||||
|                         //{ |                         { | ||||||
|                         //} |                             output.Write("\n<!--/MonsterItem-->\n\n"); | ||||||
|                         else if (keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:italic;") && keySpan.Text.Contains("taille")) |                         } | ||||||
|  |                         output.Write("<!--MonsterItem Family=\"TomeOfBeasts\"-->\n\n"); | ||||||
|  |                         output.Write($"# <!--Name-->{CultureInfo.CurrentCulture.TextInfo.ToTitleCase(keySpan.Text.ToLower())}<!--/Name-->\n\n- Source: <!--Source-->(LDM p{page})<!--/Source-->\n"); | ||||||
|  |                     } | ||||||
|  |                     else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idssni) && keySpan.Text.Contains("taille")) | ||||||
|                     {   // type / size / alignment |                     {   // type / size / alignment | ||||||
|                         // todo : découper type / size / alignment |                         // todo : découper type / size / alignment | ||||||
|                         Console.ForegroundColor = ConsoleColor.White; |                         Console.ForegroundColor = ConsoleColor.White; | ||||||
|                             output.WriteLine($"-  <!--Type-->{keySpan.Text}<!--/Alignment-->"); |                         output.Write($"-  <!--Type-->{keySpan.Text}<!--/Alignment-->\n"); | ||||||
|                     } |                     } | ||||||
|                         else if (keySpan.Style.Contains("rgba(121,27,16,1)")) |                     else if (keySpan.Style.Contains(st8_121) && keySpan.IdStyle.Contains(idssbn)) | ||||||
|                     {   // key / ... |                     {   // key / ... | ||||||
|                         string tag = ""; |                         string tag = ""; | ||||||
|                         if (KeyTags.ContainsKey(keySpan.Text.Trim())) |                         if (KeyTags.ContainsKey(keySpan.Text.Trim())) | ||||||
|  | @ -573,61 +571,65 @@ namespace AideDeJeuCmd | ||||||
|                             tag = KeyTags[keySpan.Text.Trim()]; |                             tag = KeyTags[keySpan.Text.Trim()]; | ||||||
| 
 | 
 | ||||||
|                             Console.ForegroundColor = ConsoleColor.White; |                             Console.ForegroundColor = ConsoleColor.White; | ||||||
|                                 output.Write($"- **{keySpan.Text.Trim()}**"); |                             output.Write($"- **{keySpan.Text.Trim()}** <!--{tag}-->{value}<!--/{tag}-->\n"); | ||||||
|                                 output.WriteLine($" <!--{tag}-->{value}<!--/{tag}-->"); |  | ||||||
|                         } |                         } | ||||||
|                         else |                         else | ||||||
|                         { |                         { | ||||||
|                             Console.ForegroundColor = ConsoleColor.Red; |                             Console.ForegroundColor = ConsoleColor.Red; | ||||||
|                                 error.WriteLine($"ABILITIES"); |                             //error.WriteLine($"ABILITIES"); | ||||||
|                             if (abilities == null) |                             if (abilities == null) | ||||||
|                             { |                             { | ||||||
|                                 abilities = ""; |                                 abilities = ""; | ||||||
|                             } |                             } | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                         else if (keySpan.Style.Contains("rgba(0,0,0,1)")) |                     else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idssnn)) | ||||||
|                     {   // ... / value |                     {   // ... / value | ||||||
|                             if(abilities != null) |                         if (abilities != null) | ||||||
|                         { |                         { | ||||||
|                             abilities += keySpan.Text; |                             abilities += keySpan.Text; | ||||||
|                                 if(abilities.Count(c => c == '(') == 6) |                             if (abilities.Count(c => c == '(') == 6) | ||||||
|                             { |                             { | ||||||
|                                 Console.ForegroundColor = ConsoleColor.White; |                                 Console.ForegroundColor = ConsoleColor.White; | ||||||
|                                     output.WriteLine("\n|FOR|DEX|CON|INT|SAG|CHA|\n|---|---|---|---|---|---|"); |                                 output.Write($"\n|FOR|DEX|CON|INT|SAG|CHA|\n|---|---|---|---|---|---|\n|{abilities.Replace(") ", ")").Replace(")", ")|")}\n\n"); | ||||||
|                                     output.WriteLine("|" + abilities.Replace(") ",")").Replace(")",")|") + "\n"); |  | ||||||
|                                 abilities = null; |                                 abilities = null; | ||||||
|                             } |                             } | ||||||
|                         } |                         } | ||||||
|                         else |                         else | ||||||
|                         { |                         { | ||||||
|                             Console.ForegroundColor = ConsoleColor.White; |                             Console.ForegroundColor = ConsoleColor.White; | ||||||
|                                 output.Write($"{keySpan.Text}"); |                             output.Write($"{keySpan.Text} {value}\n"); | ||||||
|                                 output.WriteLine($" {value}"); |  | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                         else if(keySpan.Style.Contains("font-size:14px;vertical-align:baseline;color:rgba(137,23,26,1);")) |                     else if (keySpan.Style.Contains(st14_137) && keySpan.IdStyle.Contains(idsnn)) | ||||||
|                     {   // actions / réactions |                     {   // actions / réactions | ||||||
|                         Console.ForegroundColor = ConsoleColor.White; |                         Console.ForegroundColor = ConsoleColor.White; | ||||||
|                             output.Write($"\n## {keySpan.Text}\n"); |                         output.Write($"\n## {keySpan.Text}\n{value}\n"); | ||||||
|                             output.WriteLine($" {value}"); |  | ||||||
|                     } |                     } | ||||||
|                         else if (keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:normal;")) |                     else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idssnn)) | ||||||
|                     { |                     { | ||||||
|                         Console.ForegroundColor = ConsoleColor.White; |                         Console.ForegroundColor = ConsoleColor.White; | ||||||
|                             output.Write($"{keySpan.Text}"); |                         output.Write($"{keySpan.Text.Trim()} {value}\n"); | ||||||
|                             output.WriteLine($" {value}"); |                     } | ||||||
|  |                     else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idssbi)) | ||||||
|  |                     { | ||||||
|  |                         Console.ForegroundColor = ConsoleColor.White; | ||||||
|  |                         output.Write($"\n**_{keySpan.Text.Trim()}_** {value}\n"); | ||||||
|  |                     } | ||||||
|  |                     else if (keySpan.Style.Contains(st8_0) && keySpan.IdStyle.Contains(idssbn)) | ||||||
|  |                     { | ||||||
|  |                         Console.ForegroundColor = ConsoleColor.White; | ||||||
|  |                         output.Write($"\n**{keySpan.Text.Trim()}** {value}\n"); | ||||||
|                     } |                     } | ||||||
|                     else |                     else | ||||||
|                     { |                     { | ||||||
|                         Console.ForegroundColor = ConsoleColor.Red; |                         Console.ForegroundColor = ConsoleColor.Red; | ||||||
|                             error.Write($"{keySpan.Text}"); |                         error.Write($"{keySpan.Text} {value}\n"); | ||||||
|                             error.WriteLine($" {value}"); |                         error.Write($"{keySpan.Style}\n"); | ||||||
|  |                         error.Write($"{keySpan.IdStyle}\n"); | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|                 //Console.ReadKey(); |  | ||||||
|             } |  | ||||||
| 
 | 
 | ||||||
|             void StripLine() |             void StripLine() | ||||||
|             { |             { | ||||||
|  | @ -1000,19 +1002,19 @@ namespace AideDeJeuCmd | ||||||
|                     { |                     { | ||||||
|                         //var file = ""; |                         //var file = ""; | ||||||
|                         var files = new Dictionary<string, string>(); |                         var files = new Dictionary<string, string>(); | ||||||
|                         foreach(var aalinks in alllinks) |                         foreach (var aalinks in alllinks) | ||||||
|                         { |                         { | ||||||
|                             var found = aalinks.Value.FirstOrDefault(t => t.Item2 == Helpers.IdFromName(unlinkedref)); |                             var found = aalinks.Value.FirstOrDefault(t => t.Item2 == Helpers.IdFromName(unlinkedref)); | ||||||
|                             if(found != null) |                             if (found != null) | ||||||
|                             { |                             { | ||||||
|                                 files[found.Item1] = $"{found.Item1}.md"; |                                 files[found.Item1] = $"{found.Item1}.md"; | ||||||
|                                 //file = $"{found.Item1}.md"; |                                 //file = $"{found.Item1}.md"; | ||||||
|                                 //Console.WriteLine($"[{unlinkedref}]: {file}#{Helpers.IdFromName(unlinkedref)}"); |                                 //Console.WriteLine($"[{unlinkedref}]: {file}#{Helpers.IdFromName(unlinkedref)}"); | ||||||
|                             } |                             } | ||||||
|                         } |                         } | ||||||
|                         foreach(var aanchors in allanchors) |                         foreach (var aanchors in allanchors) | ||||||
|                         { |                         { | ||||||
|                             if(aanchors.Value.Contains(Helpers.IdFromName(unlinkedref))) |                             if (aanchors.Value.Contains(Helpers.IdFromName(unlinkedref))) | ||||||
|                             { |                             { | ||||||
|                                 files[aanchors.Key] = $"{aanchors.Key}.md"; |                                 files[aanchors.Key] = $"{aanchors.Key}.md"; | ||||||
|                                 //file = $"{aanchors.Key}.md"; |                                 //file = $"{aanchors.Key}.md"; | ||||||
|  | @ -1020,7 +1022,7 @@ namespace AideDeJeuCmd | ||||||
|                                 //break; |                                 //break; | ||||||
|                             } |                             } | ||||||
|                         } |                         } | ||||||
|                         if(files.Count == 0) |                         if (files.Count == 0) | ||||||
|                         { |                         { | ||||||
|                             files[""] = ""; |                             files[""] = ""; | ||||||
|                         } |                         } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez