Beispiel #1
0
 private static IEnumerable <YamlHtmlPart> MarkupMultiple(IHostService host, string markdown, FileAndType ft)
 {
     try
     {
         var html  = host.MarkupToHtml(markdown, ft.File);
         var parts = YamlHtmlPart.SplitYamlHtml(html);
         foreach (var part in parts)
         {
             var mr = host.ParseHtml(part.OriginHtml, ft);
             part.LinkToFiles = mr.LinkToFiles;
             part.LinkToUids  = mr.LinkToUids;
             part.YamlHeader  = mr.YamlHeader;
         }
         return(parts);
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.Fail("Markup failed!");
         Logger.LogWarning($"Markup failed:{Environment.NewLine}  Markdown: {markdown}{Environment.NewLine}  Details:{ex.ToString()}");
         return(Enumerable.Empty <YamlHtmlPart>());
     }
 }