mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-31 07:26:09 +00:00 
			
		
		
		
	Gestion partielle des tables markdown génériques
This commit is contained in:
		
							parent
							
								
									bca32aa4a9
								
							
						
					
					
						commit
						c6d9f99c77
					
				
					 1 changed files with 28 additions and 0 deletions
				
			
		|  | @ -185,6 +185,12 @@ namespace AideDeJeu.Tools | ||||||
|                         } |                         } | ||||||
|                     } |                     } | ||||||
|                 } |                 } | ||||||
|  |                 else if (block is Markdig.Extensions.Tables.Table) | ||||||
|  |                 { | ||||||
|  |                     var tableBlock = block as Markdig.Extensions.Tables.Table; | ||||||
|  |                     spell.DescriptionHtml += tableBlock.ToMarkdownString(); | ||||||
|  |                 } | ||||||
|  | 
 | ||||||
| 
 | 
 | ||||||
|             } |             } | ||||||
|             if (spell != null) |             if (spell != null) | ||||||
|  | @ -430,6 +436,10 @@ namespace AideDeJeu.Tools | ||||||
|                         monster.Wisdom = table["WIS"].FirstOrDefault(); |                         monster.Wisdom = table["WIS"].FirstOrDefault(); | ||||||
|                         monster.Charisma = table["CHA"].FirstOrDefault(); |                         monster.Charisma = table["CHA"].FirstOrDefault(); | ||||||
|                     } |                     } | ||||||
|  |                     //else | ||||||
|  |                     //{ | ||||||
|  |                         features?.Add(tableBlock.ToMarkdownString()); | ||||||
|  |                     //} | ||||||
|                 } |                 } | ||||||
|                 else if (block is Markdig.Syntax.LinkReferenceDefinitionGroup) |                 else if (block is Markdig.Syntax.LinkReferenceDefinitionGroup) | ||||||
|                 { |                 { | ||||||
|  | @ -533,6 +543,24 @@ namespace AideDeJeu.Tools | ||||||
|             } |             } | ||||||
|             return str; |             return str; | ||||||
|         } |         } | ||||||
|  |         public static string ToMarkdownString(this Markdig.Extensions.Tables.Table tableBlock) | ||||||
|  |         { | ||||||
|  |             var ret = string.Empty; | ||||||
|  |             foreach(Markdig.Extensions.Tables.TableRow row in tableBlock) | ||||||
|  |             { | ||||||
|  |                 var line = "|"; | ||||||
|  |                 foreach(Markdig.Extensions.Tables.TableCell cell in row) | ||||||
|  |                 { | ||||||
|  |                     foreach(Markdig.Syntax.ParagraphBlock block in cell) | ||||||
|  |                     { | ||||||
|  |                         line += block.ToMarkdownString(); | ||||||
|  |                     } | ||||||
|  |                     line += "|"; | ||||||
|  |                 } | ||||||
|  |                 ret += line + "\r\n"; | ||||||
|  |             } | ||||||
|  |             return ret; | ||||||
|  |         } | ||||||
| 
 | 
 | ||||||
|         public static Dictionary<string, List<string>> ToTable(this Markdig.Extensions.Tables.Table tableBlock) |         public static Dictionary<string, List<string>> ToTable(this Markdig.Extensions.Tables.Table tableBlock) | ||||||
|         { |         { | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Nioux
						Nioux