mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 23:16:09 +00:00 
			
		
		
		
	Parsing
This commit is contained in:
		
							parent
							
								
									c3216a5dc3
								
							
						
					
					
						commit
						921baf66cb
					
				
					 1 changed files with 35 additions and 32 deletions
				
			
		|  | @ -478,40 +478,43 @@ namespace AideDeJeuCmd | |||
|                 bool started = false; | ||||
|                 foreach (var line in fullText) | ||||
|                 { | ||||
|                     foreach(var spa in line) | ||||
|                     { | ||||
|                         if (spa.Style.Contains("font-size:11px")) | ||||
|                     var keySpan = line.FirstOrDefault(); | ||||
|                     if (keySpan.Style.Contains("font-size:11px")) | ||||
|                     {   // nom (démarrage) | ||||
|                         started = true; | ||||
|                     } | ||||
|                     if (started) | ||||
|                     { | ||||
|                             if (!spa.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:normal;") && CloseKeyValue()) | ||||
| 
 | ||||
|                         string value = ""; | ||||
|                         if (line.Count > 1) | ||||
|                         { | ||||
|                             value = line.Skip(1).Select(p => p.Text).Aggregate((p1, p2) => p1 + p2); | ||||
|                         } | ||||
|                         if (keySpan.Style.Contains("font-size:11px")) | ||||
|                         {   // nom | ||||
|                             Console.WriteLine($"# <!--Name-->{keySpan.Text}<!--/Name-->"); | ||||
|                         } | ||||
|                         else if (!keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:normal;") && CloseKeyValue()) | ||||
|                         { | ||||
|                         } | ||||
|                             else if (spa.Style.Contains("font-size:11px")) | ||||
|                             {   // nom | ||||
|                                 Console.WriteLine($"# <!--Name-->{spa.Text}<!--/Name-->"); | ||||
|                             } | ||||
|                             else if (spa.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:italic;") && spa.Text.Contains("taille")) | ||||
|                         else if (keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:italic;") && keySpan.Text.Contains("taille")) | ||||
|                         {   // type / size / alignment | ||||
|                             // todo : découper type / size / alignment | ||||
|                                 Console.WriteLine($"-  <!--Type-->{spa.Text}<!--/Alignment-->"); | ||||
|                             Console.WriteLine($"-  <!--Type-->{keySpan.Text}<!--/Alignment-->"); | ||||
|                         } | ||||
|                             else if (spa.Style.Contains("rgba(121,27,16,1)")) | ||||
|                         else if (keySpan.Style.Contains("rgba(121,27,16,1)")) | ||||
|                         {   // key / value | ||||
|                                 key = spa.Text; | ||||
|                                 //Console.WriteLine($"-  <!--Type-->{span.InnerText}<!--/Alignment-->"); | ||||
|                             Console.WriteLine($"- **{keySpan.Text}** {value}"); | ||||
|                         } | ||||
|                             else if (spa.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:normal;")) | ||||
|                         else if (keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:normal;")) | ||||
|                         { | ||||
|                                 value += (value.Length == 0 ? " " : "") + spa.Text; | ||||
|                             Console.Write($"{keySpan.Text} {value}"); | ||||
|                         } | ||||
|                         else | ||||
|                         { | ||||
|                             //Console.Write($"{spanStyle} => {span.InnerText} "); | ||||
|                                 Console.Write($"{spa.Text}"); | ||||
|                             } | ||||
|                             Console.Write($"{keySpan.Text} {value}"); | ||||
|                         } | ||||
|                         //Console.Write(spa.Text); | ||||
|                     } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez