mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 07:26: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; |                 bool started = false; | ||||||
|                 foreach (var line in fullText) |                 foreach (var line in fullText) | ||||||
|                 { |                 { | ||||||
|                     foreach(var spa in line) |                     var keySpan = line.FirstOrDefault(); | ||||||
|                     { |                     if (keySpan.Style.Contains("font-size:11px")) | ||||||
|                         if (spa.Style.Contains("font-size:11px")) |  | ||||||
|                     {   // nom (démarrage) |                     {   // nom (démarrage) | ||||||
|                         started = true; |                         started = true; | ||||||
|                     } |                     } | ||||||
|                     if (started) |                     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")) |                         else if (keySpan.IdStyle.Contains("font-family:sans-serif; font-weight:normal; font-style:italic;") && keySpan.Text.Contains("taille")) | ||||||
|                             {   // 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")) |  | ||||||
|                         {   // type / size / alignment |                         {   // type / size / alignment | ||||||
|                             // todo : découper 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 / value | ||||||
|                                 key = spa.Text; |                             Console.WriteLine($"- **{keySpan.Text}** {value}"); | ||||||
|                                 //Console.WriteLine($"-  <!--Type-->{span.InnerText}<!--/Alignment-->"); |  | ||||||
|                         } |                         } | ||||||
|                             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 |                         else | ||||||
|                         { |                         { | ||||||
|                             //Console.Write($"{spanStyle} => {span.InnerText} "); |                             //Console.Write($"{spanStyle} => {span.InnerText} "); | ||||||
|                                 Console.Write($"{spa.Text}"); |                             Console.Write($"{keySpan.Text} {value}"); | ||||||
|                             } |  | ||||||
|                         } |                         } | ||||||
|                         //Console.Write(spa.Text); |                         //Console.Write(spa.Text); | ||||||
|                     } |                     } | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez